File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4515,6 +4515,8 @@ class QuicEndpoint {
45154515 truncatedReads : undefined ,
45164516 onsession : undefined ,
45174517 sessionCallbacks : undefined ,
4518+ // The encoded ALPN this endpoint listens with.
4519+ alpn : undefined ,
45184520 } ;
45194521
45204522 static {
@@ -4823,6 +4825,7 @@ class QuicEndpoint {
48234825 } = options ;
48244826
48254827 inner . truncatedReads = truncatedReads ;
4828+ inner . alpn = rest . tls . alpn ;
48264829
48274830 // Store session and stream callbacks to apply to each new incoming session.
48284831 inner . sessionCallbacks = {
@@ -5030,7 +5033,8 @@ class QuicEndpoint {
50305033 if ( identity . certs === undefined ) {
50315034 throw new ERR_MISSING_ARGS ( `entries['${ hostname } '].certs` ) ;
50325035 }
5033- processed [ hostname ] = identity ;
5036+ // These identities offer the same protocols as the ones given to listen():
5037+ processed [ hostname ] = { __proto__ : null , ...identity , alpn : this . #inner. alpn } ;
50345038 }
50355039
50365040 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