@@ -11,7 +11,7 @@ import { createHttp1Handler, createHttp2Handler } from './http-handler.js';
1111import { createTlsHandler , CertMode } from './tls-handler.js' ;
1212import { ConnectionProcessor } from './process-connection.js' ;
1313
14- import { AcmeCA , AcmeProvider , ExternalAccessBindingConfig } from './tls-certificates/acme.js' ;
14+ import { AcmeCA , AcmeProvider } from './tls-certificates/acme.js' ;
1515import { LocalCA , generateCACertificate } from './tls-certificates/local-ca.js' ;
1616import { PersistentCertCache } from './tls-certificates/cert-cache.js' ;
1717
@@ -32,9 +32,9 @@ declare module 'stream' {
3232interface ServerOptions {
3333 domain ?: string ;
3434 acmeProvider ?: AcmeProvider ;
35+ acmeAccountKey ?: string ;
3536 proactiveCertDomains ?: string [ ] ;
3637 certCacheDir ?: string ;
37- eabConfig ?: ExternalAccessBindingConfig ;
3838}
3939
4040async function generateTlsConfig ( options : ServerOptions ) {
@@ -79,8 +79,11 @@ async function generateTlsConfig(options: ServerOptions) {
7979 if ( ! options . certCacheDir || ! AcmeCA ) {
8080 throw new Error ( `Can't enable ACME without configuring a cert cache directory (via $CERT_CACHE_DIR)` ) ;
8181 }
82+ if ( ! options . acmeAccountKey ) {
83+ throw new Error ( `Can't enable ACME without configuring an account key (via $ACME_ACCOUNT_KEY)` ) ;
84+ }
8285
83- const acmeCA = new AcmeCA ( certCache ! , options . acmeProvider , options . eabConfig ) ;
86+ const acmeCA = new AcmeCA ( certCache ! , options . acmeProvider , options . acmeAccountKey ) ;
8487 acmeCA . tryGetCertificateSync ( rootDomain ) ; // Preload the root domain every time
8588
8689 return {
@@ -182,9 +185,7 @@ if (wasRunDirectly) {
182185 domain : process . env . ROOT_DOMAIN ,
183186 proactiveCertDomains : process . env . PROACTIVE_CERT_DOMAINS ?. split ( ',' ) ,
184187 acmeProvider : process . env . ACME_PROVIDER as AcmeProvider | undefined ,
185- eabConfig : process . env . ACME_EAB_KID && process . env . ACME_EAB_HMAC
186- ? { kid : process . env . ACME_EAB_KID , hmacKey : process . env . ACME_EAB_HMAC }
187- : undefined ,
188+ acmeAccountKey : process . env . ACME_ACCOUNT_KEY ,
188189 certCacheDir : process . env . CERT_CACHE_DIR
189190 } ) . then ( ( tcpHandler ) => {
190191 ports . forEach ( ( port ) => {
0 commit comments