AngelHttp.secure constructor
AngelHttp.secure(})
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.
Implementation
factory AngelHttp.secure(
Angel app,
String certificateChainPath,
String serverKeyPath, {
String? password,
bool useZone = true,
}) {
var certificateChain = Platform.script
.resolve(certificateChainPath)
.toFilePath();
var serverKey = Platform.script.resolve(serverKeyPath).toFilePath();
var serverContext = SecurityContext();
serverContext.useCertificateChain(certificateChain, password: password);
serverContext.usePrivateKey(serverKey, password: password);
return AngelHttp.fromSecurityContext(app, serverContext, useZone: useZone);
}