Skip to content

Commit

Permalink
Allow more permissive char set in SNI headers (#12147)
Browse files Browse the repository at this point in the history
Motivation:

As explained in issue #11819, certain chars such as ":" in the SNI header cause the netty pipeline to blow up.

Modifications:

By converting strings to byte arrays first, we can allow chars like ":"

Result:

Netty will have a more permissive char set allowed for SNI headers.


Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Aayush Atharva <hyperx.pro@outlook.com>
  • Loading branch information
3 people committed Mar 8, 2022
1 parent 1a84c73 commit 673849d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package io.netty.handler.ssl;

import io.netty.util.internal.SuppressJava6Requirement;
import io.netty.util.CharsetUtil;

import javax.net.ssl.SNIHostName;
import javax.net.ssl.SNIMatcher;
Expand Down Expand Up @@ -69,7 +70,7 @@ static List getSniHostNames(List<String> names) {
}
List<SNIServerName> sniServerNames = new ArrayList<SNIServerName>(names.size());
for (String name: names) {
sniServerNames.add(new SNIHostName(name));
sniServerNames.add(new SNIHostName(name.getBytes(CharsetUtil.UTF_8)));
}
return sniServerNames;
}
Expand Down

0 comments on commit 673849d

Please sign in to comment.