oatpp / oatpp-libressl

oatpp secure ConnectionProvider based on libressl
https://oatpp.io/
Apache License 2.0
4 stars 9 forks source link

Couldn’t create default server with certificate on windows #13

Closed remioukrat closed 3 years ago

remioukrat commented 3 years ago

When I try to launch a server locally on windows only with oatpp-libressl, I have an exception thrown in
the function createDefaultServerConfigShared at the following test

 if(tls_config_set_cert_file(config->getTLSConfig(), serverCertFile) < 0) {
    throw std::runtime_error("[oatpp::libressl::Config::createDefaultServerConfigShared]: failed call to tls_config_set_cert_file()");
  }

and the path stored in the serverCertFile is correct.

lganzzzo commented 3 years ago

Hello @remioukrat ,

It may be because LibreSSL is unable to parse your cert file. Please try with the self-signed test certificate from the oatpp-libressl repo - https://github.com/oatpp/oatpp-libressl/tree/master/utility/cert - just to verify that it works.

Also, make sure that you are using the correct file for the Private Key and for the Cert file. Not vice-a-versa. And that the cert file matches the private key file.

A side question: Have you tried the oatpp-openssl on windows?

remioukrat commented 3 years ago

Thanks, @lganzzzo for your answer but I have already tried with the self signed certificate from the oatpp-libressl repo. To make it works I have changed encoding end of the line (CRLF->LF) and it works.

For the side question, I don’t have tried oatpp-openssl on windows for the moment :)