Angel.secure(String certificateChainPath, String serverKeyPath, {String password})

Creates an HTTPS server. Provide paths to a certificate chain and server key (both .pem). If no password is provided, a random one will be generated upon running the server.

Source

Angel.secure(String certificateChainPath, String serverKeyPath,
    {String password})
    : super() {
  _serverGenerator = (InternetAddress address, int port) async {
    var certificateChain =
        Platform.script.resolve('server_chain.pem').toFilePath();
    var serverKey = Platform.script.resolve('server_key.pem').toFilePath();
    var serverContext = new SecurityContext();
    serverContext.useCertificateChain(certificateChain);
    serverContext.usePrivateKey(serverKey,
        password: password ?? _randomString(8));

    return await HttpServer.bindSecure(address, port, serverContext);
  };
}