Skip to content

Commit

Permalink
Merge pull request #788 from jitsni/tls.scheme.fix
Browse files Browse the repository at this point in the history
tls scheme
  • Loading branch information
jitsni authored Nov 14, 2016
2 parents 67a2bbe + b18d68e commit ed48027
Show file tree
Hide file tree
Showing 15 changed files with 593 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,11 @@ static Map<String, String> parseOptions(Node parent) {
// Skip over other node types
}
}
optionsMap.put(node.getLocalName(), nodeValue);
String localName = node.getLocalName();
if (localName.contains("tls")) {
localName = localName.replace("tls", "ssl");
}
optionsMap.put(localName, nodeValue);
}
}
return optionsMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ private Map<String, DefaultSchemeContext> resolveSchemes(Collection<? extends Se
private SchemeConfig supplySchemeConfig(String schemeName) {
SchemeConfig schemeConfig = schemeConfigsByName.get(schemeName);
if (schemeConfig == null) {
if (schemeName.contains("tls")) {
schemeName = schemeName.replace("tls", "ssl");
}
schemeConfig = findSchemeConfig(schemeName);
if (schemeConfig == null) {
throw new IllegalArgumentException("Missing scheme \"" + schemeName + "\"");
Expand Down Expand Up @@ -763,6 +766,12 @@ private Collection<String> resolveURIs(String[] acceptURIs) throws URISyntaxExce
Collection<String> urisWithPort = new HashSet<>();
for (String uri : acceptURIs) {
String resolvedURI = resolveURI(getCanonicalURI(uri, true));
if (resolvedURI.contains("tls://")) {
resolvedURI = resolvedURI.replace("tls://", "ssl://");
if (resolvedURI.endsWith("/")) {
resolvedURI = resolvedURI.substring(0, resolvedURI.length() - 1);
}
}
urisWithPort.add(resolvedURI);
}
return urisWithPort;
Expand Down
73 changes: 73 additions & 0 deletions server/src/main/xsd/gateway-config-201511.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,14 @@
</documentation>
</annotation>
</element>
<element name="tls.ciphers" maxOccurs="1" minOccurs="0" type="gateway:CSVType">
<annotation>
<documentation>A comma-separated list of
SSL/TLS ciphersuite names to be used for this
connection.
</documentation>
</annotation>
</element>
<element name="ssl.protocols" maxOccurs="1" minOccurs="0" type="gateway:CSVType">
<annotation>
<documentation>A comma-separated list of
Expand All @@ -1206,6 +1214,16 @@
</documentation>
</annotation>
</element>
<element name="tls.protocols" maxOccurs="1" minOccurs="0" type="gateway:CSVType">
<annotation>
<documentation>A comma-separated list of
SSL/TLS protocol names to be used for this
connection. The protocols names are SSLv2Hello, SSLv3, TLSv1, TLSv1.1,
TLSv1.2. If not specified explicitly, SSLv3 protocol is not
enabled by default (as it is known to have vulnerabilities).
</documentation>
</annotation>
</element>
<element name="ssl.encryption" maxOccurs="1" minOccurs="0">
<simpleType>
<restriction base="string">
Expand All @@ -1215,6 +1233,15 @@
</restriction>
</simpleType>
</element>
<element name="tls.encryption" maxOccurs="1" minOccurs="0">
<simpleType>
<restriction base="string">
<enumeration value="enabled"></enumeration>
<enumeration value="disabled"></enumeration>
<whiteSpace value="collapse"></whiteSpace>
</restriction>
</simpleType>
</element>
<element name="ssl.verify-client" maxOccurs="1" minOccurs="0">
<simpleType>
<restriction base="string">
Expand All @@ -1225,6 +1252,16 @@
</restriction>
</simpleType>
</element>
<element name="tls.verify-client" maxOccurs="1" minOccurs="0">
<simpleType>
<restriction base="string">
<enumeration value="none"></enumeration>
<enumeration value="optional"></enumeration>
<enumeration value="required"></enumeration>
<whiteSpace value="collapse"></whiteSpace>
</restriction>
</simpleType>
</element>
<element name="ws.bind" maxOccurs="1" minOccurs="0" type="gateway:CollapsedString">
<annotation/>
</element>
Expand All @@ -1240,6 +1277,9 @@
<element name="ssl.bind" maxOccurs="1" minOccurs="0" type="gateway:CollapsedString">
<annotation/>
</element>
<element name="tls.bind" maxOccurs="1" minOccurs="0" type="gateway:CollapsedString">
<annotation/>
</element>
<element name="tcp.bind" maxOccurs="1" minOccurs="0" type="gateway:CollapsedString">
<annotation/>
</element>
Expand All @@ -1261,6 +1301,9 @@
<element name="ssl.transport" maxOccurs="1" minOccurs="0" type="anyURI">
<annotation/>
</element>
<element name="tls.transport" maxOccurs="1" minOccurs="0" type="anyURI">
<annotation/>
</element>
<element name="http.transport" maxOccurs="1" minOccurs="0" type="anyURI">
<annotation/>
</element>
Expand All @@ -1284,6 +1327,14 @@
</documentation>
</annotation>
</element>
<element name="tls.ciphers" maxOccurs="1" minOccurs="0" type="gateway:CSVType">
<annotation>
<documentation>A comma-separated list of
SSL/TLS ciphersuite names to be used for this
connection.
</documentation>
</annotation>
</element>
<element name="ssl.protocols" maxOccurs="1" minOccurs="0" type="gateway:CSVType">
<annotation>
<documentation>A comma-separated list of
Expand All @@ -1294,6 +1345,16 @@
</documentation>
</annotation>
</element>
<element name="tls.protocols" maxOccurs="1" minOccurs="0" type="gateway:CSVType">
<annotation>
<documentation>A comma-separated list of
SSL/TLS protocol names to be used for this
connection. The protocols names are SSLv2Hello, SSLv3, TLSv1, TLSv1.1,
TLSv1.2. If not specified explicitly, SSLv3 protocol is not
enabled by default (as it is known to have vulnerabilities).
</documentation>
</annotation>
</element>
<element name="ssl.encryption" maxOccurs="1" minOccurs="0">
<simpleType>
<restriction base="string">
Expand All @@ -1303,6 +1364,15 @@
</restriction>
</simpleType>
</element>
<element name="tls.encryption" maxOccurs="1" minOccurs="0">
<simpleType>
<restriction base="string">
<enumeration value="enabled"></enumeration>
<enumeration value="disabled"></enumeration>
<whiteSpace value="collapse"></whiteSpace>
</restriction>
</simpleType>
</element>
<element name="tcp.bind" maxOccurs="1" minOccurs="0" type="gateway:CollapsedString">
<annotation/>
</element>
Expand All @@ -1318,6 +1388,9 @@
<element name="ssl.transport" maxOccurs="1" minOccurs="0" type="anyURI">
<annotation/>
</element>
<element name="tls.transport" maxOccurs="1" minOccurs="0" type="anyURI">
<annotation/>
</element>
<element name="http.transport" maxOccurs="1" minOccurs="0" type="anyURI">
<annotation/>
</element>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1256,6 +1256,14 @@
connection.
</documentation>
</annotation>
</element>
<element name="tls.ciphers" maxOccurs="1" minOccurs="0" type="gateway:CSVType">
<annotation>
<documentation>A comma-separated list of
SSL/TLS ciphersuite names to be used for this
connection.
</documentation>
</annotation>
</element>
<element name="ssl.protocols" maxOccurs="1" minOccurs="0" type="gateway:CSVType">
<annotation>
Expand All @@ -1267,6 +1275,16 @@
</documentation>
</annotation>
</element>
<element name="tls.protocols" maxOccurs="1" minOccurs="0" type="gateway:CSVType">
<annotation>
<documentation>A comma-separated list of
SSL/TLS protocol names to be used for this
connection. The protocols names are SSLv2Hello, SSLv3, TLSv1, TLSv1.1,
TLSv1.2. If not specified explicitly, SSLv3 protocol is not
enabled by default (as it is known to have vulnerabilities).
</documentation>
</annotation>
</element>
<element name="ssl.encryption" maxOccurs="1" minOccurs="0">
<simpleType>
<restriction base="string">
Expand All @@ -1276,6 +1294,15 @@
</restriction>
</simpleType>
</element>
<element name="tls.encryption" maxOccurs="1" minOccurs="0">
<simpleType>
<restriction base="string">
<enumeration value="enabled"></enumeration>
<enumeration value="disabled"></enumeration>
<whiteSpace value="collapse"></whiteSpace>
</restriction>
</simpleType>
</element>
<element name="ssl.verify-client" maxOccurs="1" minOccurs="0">
<simpleType>
<restriction base="string">
Expand All @@ -1286,6 +1313,16 @@
</restriction>
</simpleType>
</element>
<element name="tls.verify-client" maxOccurs="1" minOccurs="0">
<simpleType>
<restriction base="string">
<enumeration value="none"></enumeration>
<enumeration value="optional"></enumeration>
<enumeration value="required"></enumeration>
<whiteSpace value="collapse"></whiteSpace>
</restriction>
</simpleType>
</element>
<element name="ws.bind" maxOccurs="1" minOccurs="0" type="gateway:CollapsedString">
<annotation/>
</element>
Expand All @@ -1301,6 +1338,9 @@
<element name="ssl.bind" maxOccurs="1" minOccurs="0" type="gateway:CollapsedString">
<annotation/>
</element>
<element name="tls.bind" maxOccurs="1" minOccurs="0" type="gateway:CollapsedString">
<annotation/>
</element>
<element name="tcp.bind" maxOccurs="1" minOccurs="0" type="gateway:CollapsedString">
<annotation/>
</element>
Expand All @@ -1325,6 +1365,9 @@
<element name="ssl.transport" maxOccurs="1" minOccurs="0" type="anyURI">
<annotation/>
</element>
<element name="tls.transport" maxOccurs="1" minOccurs="0" type="anyURI">
<annotation/>
</element>
<element name="http.transport" maxOccurs="1" minOccurs="0" type="anyURI">
<annotation/>
</element>
Expand Down Expand Up @@ -1358,6 +1401,14 @@
</documentation>
</annotation>
</element>
<element name="tls.ciphers" maxOccurs="1" minOccurs="0" type="gateway:CSVType">
<annotation>
<documentation>A comma-separated list of
SSL/TLS ciphersuite names to be used for this
connection.
</documentation>
</annotation>
</element>
<element name="ssl.protocols" maxOccurs="1" minOccurs="0" type="gateway:CSVType">
<annotation>
<documentation>A comma-separated list of
Expand All @@ -1368,6 +1419,16 @@
</documentation>
</annotation>
</element>
<element name="tls.protocols" maxOccurs="1" minOccurs="0" type="gateway:CSVType">
<annotation>
<documentation>A comma-separated list of
SSL/TLS protocol names to be used for this
connection. The protocols names are SSLv2Hello, SSLv3, TLSv1, TLSv1.1,
TLSv1.2. If not specified explicitly, SSLv3 protocol is not
enabled by default (as it is known to have vulnerabilities).
</documentation>
</annotation>
</element>
<element name="ssl.encryption" maxOccurs="1" minOccurs="0">
<simpleType>
<restriction base="string">
Expand All @@ -1377,6 +1438,15 @@
</restriction>
</simpleType>
</element>
<element name="tls.encryption" maxOccurs="1" minOccurs="0">
<simpleType>
<restriction base="string">
<enumeration value="enabled"></enumeration>
<enumeration value="disabled"></enumeration>
<whiteSpace value="collapse"></whiteSpace>
</restriction>
</simpleType>
</element>
<element name="tcp.bind" maxOccurs="1" minOccurs="0" type="gateway:CollapsedString">
<annotation/>
</element>
Expand All @@ -1392,6 +1462,9 @@
<element name="ssl.transport" maxOccurs="1" minOccurs="0" type="anyURI">
<annotation/>
</element>
<element name="tls.transport" maxOccurs="1" minOccurs="0" type="anyURI">
<annotation/>
</element>
<element name="http.transport" maxOccurs="1" minOccurs="0" type="anyURI">
<annotation/>
</element>
Expand Down
Loading

0 comments on commit ed48027

Please sign in to comment.