-
-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for setting certificate on PeerConnection #1170
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've no idea why at the moment but MbedTLS fails to parse the certificate in the test.
include/rtc/configuration.hpp
Outdated
optional<string> certPem; | ||
optional<string> keyPem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should make the configuration fields consistent with existing ones in WebSocketConfiguration
and WebSocketServerConfiguration
. The fields are called certificatePemFile
, keyPemFile
, and keyPemPass
, they allow the user to pass certificate and key either as a file path or as a PEM string.
src/impl/peerconnection.cpp
Outdated
std::promise<certificate_ptr> cert; | ||
cert.set_value(std::make_shared<Certificate>(Certificate::FromString(config.certPem.value(), config.keyPem.value()))); | ||
mCertificate = cert.get_future(); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should create the certificate if both certificate and key are not specified, else throw an invalid_argument
exception (like in WebSocketServer).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get it.
I am also confused, this certificate is created in openssl. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good, thank you.
16c917f
into
paullouisageneau:master
Issue with MbedTLS parsing was preexisting, it is fixed by #1180 |
great! |
In Peer B of the WebRTC Direct protocol, a specific certificate and private key need to be specified in order for Peer B to maintain a fixed fingerprint.