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

(-)java/org/apache/tomcat/websocket/Constants.java (+17 lines)
Lines 47-68 Link Here
47
47
48
    // Client connection
48
    // Client connection
49
    /**
49
    /**
50
     * Property name to set to configure the SSLEngine that will be used.  The
51
     * value should be an instance of SSLEngine.  If this property is present,
52
     * the SSL_PROTOCOLS, SSL_TRUSTSTORE*, and SSL_CONTEXT properies will be
53
     * ignored.
54
     */
55
    public static final String SSL_ENGINE_PROPERTY =
56
            "org.apache.tomcat.websocket.SSL_ENGINE";
57
    /**
50
     * Property name to set to configure the value that is passed to
58
     * Property name to set to configure the value that is passed to
51
     * {@link javax.net.ssl.SSLEngine#setEnabledProtocols(String[])}. The value
59
     * {@link javax.net.ssl.SSLEngine#setEnabledProtocols(String[])}. The value
52
     * should be a comma separated string.
60
     * should be a comma separated string.
61
     *
62
     * @deprecated Use SSL_ENGINE_PROPERTY instead.
53
     */
63
     */
64
    @Deprecated
54
    public static final String SSL_PROTOCOLS_PROPERTY =
65
    public static final String SSL_PROTOCOLS_PROPERTY =
55
            "org.apache.tomcat.websocket.SSL_PROTOCOLS";
66
            "org.apache.tomcat.websocket.SSL_PROTOCOLS";
67
    @Deprecated
56
    public static final String SSL_TRUSTSTORE_PROPERTY =
68
    public static final String SSL_TRUSTSTORE_PROPERTY =
57
            "org.apache.tomcat.websocket.SSL_TRUSTSTORE";
69
            "org.apache.tomcat.websocket.SSL_TRUSTSTORE";
70
    @Deprecated
58
    public static final String SSL_TRUSTSTORE_PWD_PROPERTY =
71
    public static final String SSL_TRUSTSTORE_PWD_PROPERTY =
59
            "org.apache.tomcat.websocket.SSL_TRUSTSTORE_PWD";
72
            "org.apache.tomcat.websocket.SSL_TRUSTSTORE_PWD";
73
    @Deprecated
60
    public static final String SSL_TRUSTSTORE_PWD_DEFAULT = "changeit";
74
    public static final String SSL_TRUSTSTORE_PWD_DEFAULT = "changeit";
61
    /**
75
    /**
62
     * Property name to set to configure used SSLContext. The value should be an
76
     * Property name to set to configure used SSLContext. The value should be an
63
     * instance of SSLContext. If this property is present, the SSL_TRUSTSTORE*
77
     * instance of SSLContext. If this property is present, the SSL_TRUSTSTORE*
64
     * properties are ignored.
78
     * properties are ignored.
79
     *
80
     * @deprecated Use SSL_ENGINE_PROPERTY instead.
65
     */
81
     */
82
    @Deprecated
66
    public static final String SSL_CONTEXT_PROPERTY =
83
    public static final String SSL_CONTEXT_PROPERTY =
67
            "org.apache.tomcat.websocket.SSL_CONTEXT";
84
            "org.apache.tomcat.websocket.SSL_CONTEXT";
68
    /**
85
    /**
(-)java/org/apache/tomcat/websocket/WsWebSocketContainer.java (-2 / +13 lines)
Lines 870-876 Link Here
870
            throws DeploymentException {
870
            throws DeploymentException {
871
871
872
        try {
872
        try {
873
            // See if a custom SSLContext has been provided
873
            // See if a custom SSLEngine has been provided.  This is the
874
            // preferred way to configure the container.
875
            SSLEngine engine = (SSLEngine) userProperties.get(
876
                    Constants.SSL_ENGINE_PROPERTY);
877
                    
878
            if (null != engine)
879
            {
880
                return engine;
881
            }
882
            
883
            // As a fallback, see if a custom SSLContext has been provided;
884
            // the SSLContext can be used to create an SSLEngine.
874
            SSLContext sslContext =
885
            SSLContext sslContext =
875
                    (SSLContext) userProperties.get(Constants.SSL_CONTEXT_PROPERTY);
886
                    (SSLContext) userProperties.get(Constants.SSL_CONTEXT_PROPERTY);
876
887
Lines 904-910 Link Here
904
                }
915
                }
905
            }
916
            }
906
917
907
            SSLEngine engine = sslContext.createSSLEngine();
918
            engine = sslContext.createSSLEngine();
908
919
909
            String sslProtocolsValue =
920
            String sslProtocolsValue =
910
                    (String) userProperties.get(Constants.SSL_PROTOCOLS_PROPERTY);
921
                    (String) userProperties.get(Constants.SSL_PROTOCOLS_PROPERTY);

Return to bug 60597