Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] How to set order of cipher suites for Jetty SSL?

Am 12.03.2014 21:26, schrieb Justina Cheng:
> I saw a post about how to set order of cipher suites for Jetty
> on Stack Overflow
> (http://stackoverflow.com/questions/18981277/how-to-set-order-of-cipher-suites-for-jetty-ssl).
>   But, no one answer the question yet.   Does anyone know the answer?

There might be other solutions but I already have my own implementation
of a ContextFactory so I've done it there:

public class AuthServiceSSLContextFactory extends SslContextFactory{
   [...]

    /**
     * Creates a new ServerSocket
     * @param host the interface to bind with
     * @param port the port to bind at
     * @param backlog the number of back logged connections that are allowed
     * @throws IOException Will be thrown if there was an error while
     * creating the server socket
     */
    @Override
    public SSLServerSocket newSslServerSocket(String host, int port, int backlog) throws IOException {
        SSLServerSocket ret = super.newSslServerSocket(host, port, backlog);
        ret.setEnabledCipherSuites(CryptoTools.getResortedCipherSuites(ret.getEnabledCipherSuites()));
        return ret;
    }

    /**
     * Creates a new SSL Socket
     * @return the created socket
     * @throws IOException Will be thrown if there was an error while
     * creating the socket
     */
    @Override
    public SSLSocket newSslSocket() throws IOException {
        SSLSocket ret = super.newSslSocket();
        ret.setEnabledCipherSuites(CryptoTools.getResortedCipherSuites(ret.getEnabledCipherSuites()));
        return ret;
    }
}


Regards, Lothar


Back to the top