So I'm writing a server in Dart and want to enable SSL. The bindSecure
function is supposed to accomplish that for me, but I can't seem to figure out how to actually refer to the certificate. Let's say that I write the function like so:
HttpServer.bindSecure('localhost', 3000, 'my_cert.pem').then((HttpServer server) {
... do stuff with server ...
});
I've tried doing this with the .pem
file in the same directory as the server file, but to no avail. I always get the following error:
Uncaught Error: CertificateException: Cannot find server certificate by nickname: my_cert.pem
I've also tried using ./my_cert.pem
, linking from the root directory of the overall project, etc., but so far to no avail.