Skip to content

Commit af37f2e

Browse files
authored
Merge pull request #3884 from adamretter/backport/fix-ssl-cert
Fixes for SSL
2 parents 80f3d0b + 0a8c613 commit af37f2e

File tree

4 files changed

+38
-7
lines changed

4 files changed

+38
-7
lines changed

exist-distribution/src/main/xslt/jetty-deploy.xslt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
-->
2525
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2626
version="2.0">
27-
<xsl:output method="xml" omit-xml-declaration="no" doctype-public="-//Jetty//Configure//EN" doctype-system="http://www.eclipse.org/jetty/configure_9_3.dtd"/>
27+
<xsl:output method="xml" omit-xml-declaration="no" doctype-public="-//Jetty//Configure//EN" doctype-system="http://www.eclipse.org/jetty/configure_9_3.dtd" indent="yes"/>
2828
<xsl:template match="Set[@name eq 'monitoredDirName']">
2929
<xsl:copy><xsl:copy-of select="@*"/><xsl:copy-of select="Property[@name eq 'jetty.base']"/>/etc/jetty/<xsl:copy-of select="Property[@name eq 'jetty.deploy.monitoredDir']"/></xsl:copy>
3030
</xsl:template>
@@ -35,7 +35,7 @@
3535
<xsl:copy><xsl:copy-of select="@*"/><xsl:copy-of select="SystemProperty/Default/Property[@name eq 'jetty.home']"/>/etc/<xsl:value-of select="tokenize(SystemProperty/Default/text(),'/')[last() - 1]"/></xsl:copy>
3636
</xsl:template>
3737
<xsl:template match="Property[@name = ('jetty.sslContext.keyStorePath', 'jetty.sslContext.trustStorePath')]">
38-
<xsl:copy><xsl:copy-of select="@*[local-name(.) ne 'default']"/><xsl:attribute name="default" select="'etc/jetty/keystore'"/></xsl:copy>
38+
<xsl:copy><xsl:copy-of select="@*[local-name(.) ne 'default']"/><xsl:attribute name="default" select="'etc/jetty/keystore.p12'"/></xsl:copy>
3939
</xsl:template>
4040
<xsl:template match="node()|@*">
4141
<xsl:copy>

exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-ssl-context.xml

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
1212

1313
<Configure id="sslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory$Server">
1414
<Set name="Provider"><Property name="jetty.sslContext.provider"/></Set>
15-
<Set name="KeyStorePath"><Property name="jetty.base" default="." />/<Property name="jetty.sslContext.keyStorePath" deprecated="jetty.keystore" default="etc/keystore"/></Set>
15+
<Set name="KeyStorePath"><Property name="jetty.base" default="." />/<Property name="jetty.sslContext.keyStorePath" deprecated="jetty.keystore" default="etc/keystore.p12"/></Set>
1616
<Set name="KeyStorePassword"><Property name="jetty.sslContext.keyStorePassword" deprecated="jetty.keystore.password" default="OBF:1yta1t331v8w1v9q1t331ytc"/></Set>
17-
<Set name="KeyStoreType"><Property name="jetty.sslContext.keyStoreType" default="JKS"/></Set>
17+
<Set name="KeyStoreType"><Property name="jetty.sslContext.keyStoreType" default="PKCS12"/></Set>
1818
<Set name="KeyStoreProvider"><Property name="jetty.sslContext.keyStoreProvider"/></Set>
19+
<Set name="CertAlias"><Property name="jetty.keystore.alias" default="existdb"/></Set>
1920
<Set name="KeyManagerPassword"><Property name="jetty.sslContext.keyManagerPassword" deprecated="jetty.keymanager.password" default="OBF:1yta1t331v8w1v9q1t331ytc"/></Set>
20-
<Set name="TrustStorePath"><Property name="jetty.base" default="." />/<Property name="jetty.sslContext.trustStorePath" deprecated="jetty.truststore" default="etc/keystore"/></Set>
21+
<Set name="TrustStorePath"><Property name="jetty.base" default="." />/<Property name="jetty.sslContext.trustStorePath" deprecated="jetty.truststore" default="etc/keystore.p12"/></Set>
2122
<Set name="TrustStorePassword"><Property name="jetty.sslContext.trustStorePassword" deprecated="jetty.truststore.password" default="OBF:1yta1t331v8w1v9q1t331ytc"/></Set>
22-
<Set name="TrustStoreType"><Property name="jetty.sslContext.trustStoreType"/></Set>
23+
<Set name="TrustStoreType"><Property name="jetty.sslContext.trustStoreType" default="PKCS12"/></Set>
2324
<Set name="TrustStoreProvider"><Property name="jetty.sslContext.trustStoreProvider"/></Set>
2425
<Set name="EndpointIdentificationAlgorithm"><Property name="jetty.sslContext.endpointIdentificationAlgorithm"/></Set>
2526
<Set name="NeedClientAuth"><Property name="jetty.sslContext.needClientAuth" deprecated="jetty.ssl.needClientAuth" default="false"/></Set>
@@ -30,7 +31,37 @@
3031
<Set name="RenegotiationAllowed"><Property name="jetty.sslContext.renegotiationAllowed" default="true"/></Set>
3132
<Set name="RenegotiationLimit"><Property name="jetty.sslContext.renegotiationLimit" default="5"/></Set>
3233
<Set name="SniRequired"><Property name="jetty.sslContext.sniRequired" default="false"/></Set>
33-
34+
35+
<!-- Eliminate Old / Insecure / Anonymous Ciphers -->
36+
<Call name="addExcludeCipherSuites">
37+
<Arg>
38+
<Array type="String">
39+
<Item>.*NULL.*</Item>
40+
<Item>.*RC4.*</Item>
41+
<Item>.*MD5.*</Item>
42+
<Item>.*DES.*</Item>
43+
<Item>.*DSS.*</Item>
44+
</Array>
45+
</Arg>
46+
</Call>
47+
48+
<!-- Eliminate Insecure Protocols
49+
Since 2014 SSLv3 is considered insecure and should be disabled.
50+
-->
51+
<Call name="addExcludeProtocols">
52+
<Arg>
53+
<Array type="java.lang.String">
54+
<Item>SSL</Item>
55+
<Item>SSLv2</Item>
56+
<Item>SSLv2Hello</Item>
57+
<Item>SSLv3</Item>
58+
</Array>
59+
</Arg>
60+
</Call>
61+
62+
<!-- TLS renegotiation is disabled too to prevent an attack based on this feature. -->
63+
<Set name="renegotiationAllowed">FALSE</Set>
64+
3465
<!-- Example of how to configure a PKIX Certificate Path revocation Checker
3566
<Call id="pkixPreferCrls" class="java.security.cert.PKIXRevocationChecker$Option" name="valueOf"><Arg>PREFER_CRLS</Arg></Call>
3667
<Call id="pkixSoftFail" class="java.security.cert.PKIXRevocationChecker$Option" name="valueOf"><Arg>SOFT_FAIL</Arg></Call>
-2.23 KB
Binary file not shown.
6.03 KB
Binary file not shown.

0 commit comments

Comments
 (0)