1

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.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
lucperkins
  • 768
  • 1
  • 7
  • 15

1 Answers1

0

in this post Secure Sockets and Servers with Dart 1.0 it is used like

'CN=my_cert'

where my_cert is the common name you used when you created the certificate.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
  • Unfortunately, that doesn't seem to work. But the problem could very well be in the certificate generation process. – lucperkins Feb 12 '14 at 21:37