paullouisageneau / libdatachannel

C/C++ WebRTC network library featuring Data Channels, Media Transport, and WebSockets
https://libdatachannel.org/
Mozilla Public License 2.0
1.81k stars 366 forks source link

Add an option to disable TLS verification #126

Closed Kyrio closed 4 years ago

Kyrio commented 4 years ago

Would you consider adding a flag or an argument that allows the user to disable TLS verification in the WebSocket API? Currently, it is disabled under OpenSSL on Windows and when the certificate directory cannot be found.

It is difficult to use ws:// anywhere else than locally, with Heroku and others forcing wss://. Being able to skip certificate verification would be useful for development purposes :)

https://github.com/paullouisageneau/libdatachannel/blob/3d7764c1e966a74287a44525d90efd67cb700cf9/src/tlstransport.cpp#L272

paullouisageneau commented 4 years ago

Yes, it sounds good, it can indeed be useful.

paullouisageneau commented 4 years ago

With #127, TLS certificate verification can be disabled at creation:

std::make_shared<WebSocket>(WebSocket::Configuration{.disableTlsVerification = true});
Kyrio commented 4 years ago

Thanks for adding this so quickly!