Java Code Examples for org.apache.tomcat.util.compat.JreCompat#isJre8Available()

The following examples show how to use org.apache.tomcat.util.compat.JreCompat#isJre8Available() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractJsseEndpoint.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
private void testServerCipherSuitesOrderSupport() {
    // Only need to test for this if running on Java < 8 and not using the
    // OpenSSL SSLImplementation
    if(!JreCompat.isJre8Available() &&
            !OpenSSLImplementation.class.getName().equals(getSslImplementationName())) {
        for (SSLHostConfig sslHostConfig : sslHostConfigs.values()) {
            if (sslHostConfig.getHonorCipherOrder() != null) {
                throw new UnsupportedOperationException(
                        sm.getString("endpoint.jsse.cannotHonorServerCipherOrder"));
            }
        }
    }
}
 
Example 2
Source File: SSLHostConfig.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
/**
 * @return An OpenSSL cipher string for the current configuration.
 */
public String getCiphers() {
    if (ciphers == null) {
        if (!JreCompat.isJre8Available() && Type.JSSE.equals(configType)) {
            ciphers = DEFAULT_CIPHERS + ":!DHE";
        } else {
            ciphers = DEFAULT_CIPHERS;
        }

    }
    return ciphers;
}
 
Example 3
Source File: TesterBug50640SslImpl.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Override
public SSLUtil getSSLUtil(SSLHostConfigCertificate certificate) {
    SSLHostConfig sslHostConfig = certificate.getSSLHostConfig();
    if (sslHostConfig.getProtocols().size() == 1 &&
            sslHostConfig.getProtocols().contains(PROPERTY_VALUE)) {
        if (JreCompat.isJre8Available()) {
            sslHostConfig.setProtocols(Constants.SSL_PROTO_TLSv1_2);
        } else {
            sslHostConfig.setProtocols(Constants.SSL_PROTO_TLSv1);
        }
        return super.getSSLUtil(certificate);
    } else {
        return null;
    }
}
 
Example 4
Source File: AbstractEndpoint.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
private void testServerCipherSuitesOrderSupport() {
    // Only test this feature if the user explicitly requested its use.
    if(!"".equals(getUseServerCipherSuitesOrder().trim())) {
        if (!JreCompat.isJre8Available()) {
            throw new UnsupportedOperationException(
                    sm.getString("endpoint.jsse.cannotHonorServerCipherOrder"));
        }
    }
}
 
Example 5
Source File: AbstractEndpoint.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
private void testServerCipherSuitesOrderSupport() {
    // Only test this feature if the user explicitly requested its use.
    if(!"".equals(getUseServerCipherSuitesOrder().trim())) {
        if (!JreCompat.isJre8Available()) {
            throw new UnsupportedOperationException(
                    sm.getString("endpoint.jsse.cannotHonorServerCipherOrder"));
        }
    }
}