View | Details | Raw Unified | Return to bug 55801
Collapse All | Expand All

(-)java/org/apache/tomcat/websocket/WsWebSocketContainer.java (-5 / +18 lines)
Lines 87-92 Link Here
87
    public static final String SSL_TRUSTSTORE_PWD_PROPERTY =
87
    public static final String SSL_TRUSTSTORE_PWD_PROPERTY =
88
            "org.apache.tomcat.websocket.SSL_TRUSTSTORE_PWD";
88
            "org.apache.tomcat.websocket.SSL_TRUSTSTORE_PWD";
89
    public static final String SSL_TRUSTSTORE_PWD_DEFAULT = "changeit";
89
    public static final String SSL_TRUSTSTORE_PWD_DEFAULT = "changeit";
90
    
91
    /**
92
     * Property name to set to configure used SSLContext.
93
     * The value should be an instance of SSLContext.
94
     */
95
    public static final String SSL_CONTEXT_PROPERTY =
96
            "org.apache.tomcat.websocket.SSL_CONTEXT";
90
97
91
    /**
98
    /**
92
     * Property name to set to configure the timeout (in milliseconds) when
99
     * Property name to set to configure the timeout (in milliseconds) when
Lines 671-683 Link Here
671
            throws DeploymentException {
678
            throws DeploymentException {
672
679
673
        try {
680
        try {
674
            // Create the SSL Context
681
682
            // SSL Context
683
            SSLContext sslContextValue = (SSLContext) userProperties
684
                    .get(SSL_CONTEXT_PROPERTY);
685
            // Trust store
686
            String sslTrustStoreValue = (String) userProperties
687
                    .get(SSL_TRUSTSTORE_PROPERTY);
688
675
            SSLContext sslContext = SSLContext.getInstance("TLS");
689
            SSLContext sslContext = SSLContext.getInstance("TLS");
676
690
677
            // Trust store
691
            if(sslContextValue != null) {
678
            String sslTrustStoreValue =
692
            	sslContext = sslContextValue;
679
                    (String) userProperties.get(SSL_TRUSTSTORE_PROPERTY);
693
            } else if (sslTrustStoreValue != null) {
680
            if (sslTrustStoreValue != null) {
681
                String sslTrustStorePwdValue = (String) userProperties.get(
694
                String sslTrustStorePwdValue = (String) userProperties.get(
682
                        SSL_TRUSTSTORE_PWD_PROPERTY);
695
                        SSL_TRUSTSTORE_PWD_PROPERTY);
683
                if (sslTrustStorePwdValue == null) {
696
                if (sslTrustStorePwdValue == null) {

Return to bug 55801