Skip to content

Commit 245cfc6

Browse files
committed
feat: load ca certs from memory
* Fixed up tests to work with the ca certs. * Polykey generated certs now work with CA. * Related #9 [ci skip]
1 parent ab33a67 commit 245cfc6

File tree

4 files changed

+226
-180
lines changed

4 files changed

+226
-180
lines changed

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export function retry(scid: Uint8Array, dcid: Uint8Array, newScid: Uint8Array, t
132132
export function versionIsSupported(version: number): boolean
133133
export class Config {
134134
constructor()
135-
static withBoringSslCtx(certPem?: Uint8Array | undefined | null, keyPem?: Uint8Array | undefined | null, supportedKeyAlgos?: string | undefined | null): Config
135+
static withBoringSslCtx(certPem?: Uint8Array | undefined | null, keyPem?: Uint8Array | undefined | null, supportedKeyAlgos?: string | undefined | null, caCertPem?: Uint8Array | undefined | null): Config
136136
loadCertChainFromPemFile(file: string): void
137137
loadPrivKeyFromPemFile(file: string): void
138138
loadVerifyLocationsFromFile(file: string): void

src/native/napi/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl Config {
102102
// Processing CA certificate
103103
if let Some(ca_cert_pem) = ca_cert_pem {
104104
let x509_certs = boring::x509::X509::stack_from_pem(
105-
&cert_pem.to_vec()
105+
&ca_cert_pem.to_vec()
106106
).or_else(
107107
|err| Err(Error::from_reason(err.to_string()))
108108
)?;

0 commit comments

Comments
 (0)