catbird icon indicating copy to clipboard operation
catbird copied to clipboard

Add scripts to generate certificate and add it to the macOS Keychain and iOS Keychain

Open subdan opened this issue 3 years ago • 1 comments
trafficstars

Scripts/generate-self-signed-certificate.sh — generates self signed certificate (root-ca.pem) using Scripts/cert.config config file. Scripts/extract-certificate-from-keychain.sh — extracts certificate from the local macOS Keychain Scripts/add-certificate-to-system-keychain.sh — adds a certificate to the local macOS Keychain Scripts/add-certificate-to-ios-keychain.sh — adds a certificate to the booted iOS Simulator

Closes #41

subdan avatar Nov 27 '21 14:11 subdan

I checked like this

import NIOSSL

// ...

try app.http.server.configuration.tlsConfiguration = .makeServerConfiguration(
    certificateChain: NIOSSLCertificate.fromPEMFile("cert.pem").map { .certificate($0) },
    privateKey: .file("cert.key")
)

Alexander-Ignition avatar Dec 03 '21 11:12 Alexander-Ignition