File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4449,6 +4449,8 @@ class QuicEndpoint {
44494449 truncatedReads : undefined ,
44504450 onsession : undefined ,
44514451 sessionCallbacks : undefined ,
4452+ // The encoded ALPN this endpoint listens with.
4453+ alpn : undefined ,
44524454 } ;
44534455
44544456 static {
@@ -4757,6 +4759,7 @@ class QuicEndpoint {
47574759 } = options ;
47584760
47594761 inner . truncatedReads = truncatedReads ;
4762+ inner . alpn = rest . tls . alpn ;
47604763
47614764 // Store session and stream callbacks to apply to each new incoming session.
47624765 inner . sessionCallbacks = {
@@ -4964,7 +4967,8 @@ class QuicEndpoint {
49644967 if ( identity . certs === undefined ) {
49654968 throw new ERR_MISSING_ARGS ( `entries['${ hostname } '].certs` ) ;
49664969 }
4967- processed [ hostname ] = identity ;
4970+ // These identities offer the same protocols as the ones given to listen():
4971+ processed [ hostname ] = { __proto__ : null , ...identity , alpn : this . #inner. alpn } ;
49684972 }
49694973
49704974 this . #handle. setSNIContexts ( processed , replace ) ;
Original file line number Diff line number Diff line change @@ -48,7 +48,10 @@ const serverEndpoint = await listen(mustCall(async (serverSession) => {
4848}
4949
5050endpoint . setSNIContexts (
51- { '*' : { keys : [ key2 ] , certs : [ cert2 ] } } ,
51+ {
52+ '*' : { keys : [ key2 ] , certs : [ cert2 ] } ,
53+ 'localhost' : { keys : [ key2 ] , certs : [ cert2 ] } ,
54+ } ,
5255 { replace : true } ,
5356) ;
5457
You can’t perform that action at this time.
0 commit comments