I’m trying to run the SSL examples from boost::asio and I’m getting an “Invalid argument” exception when I run them. I’m on Linux x86_64.
http://www.boost.org/doc/libs/1_46_1/doc/html/boost_asio/example/ssl/client.cpp
http://www.boost.org/doc/libs/1_46_1/doc/html/boost_asio/example/ssl/server.cpp
Compiled with:
g++ server.cpp -o server -lboost_system -lssl
g++ client.cpp -o client -lboost_system -lssl
Run like:
$ ./server
Usage: server <port>
$ ./server 10000
Exception: Invalid argument
$ ./server 1000
Exception: Permission denied
$ sudo ./server 1000
Exception: Invalid argument
Not sure what the problem is 🙁
Any help would be greatly appreciated.
Thanks!
OK, for anyone finding this in the future, you need to create your certificates and sign them appropriately.
Here are the commands for linux:
//Generate a private key
//Generate Certificate signing request
//Sign certificate with private key
//Remove password requirement (needed for example)
//Generate dhparam file
Once you’ve done that, you need to change the filenames in server.cpp and client.cpp.
server.cpp
client.cpp
Then it should all work!