Jetty 9.3 SSL Performance

Continuation from SSL Performance comparison of Tomcat, JBoss, httpd and Weblogic:
https://middlewarelive.wordpress.com/2016/10/24/simple-ssl-perfomance-comparison/

 

Command used to test:

# openssl s_time -connect localhost:$PORT -new

Jetty 9.3:
435 connections in 10.48s; 41.51 connections/user sec, bytes read 0
435 connections in 31 real seconds, 0 bytes read per connection

Advertisements

Testing Jetty 9.3 using testssl.sh

Default configuration seems to be secure enough; only need to add “-Djdk.tls.rejectClientInitiatedRenegotiation=true”.

[root@localhost testssl]# ./testssl.sh –quiet localhost:8443

No engine or GOST support via engine with your /usr/bin/openssl

Testing now (2016-11-29 11:54) —> 127.0.0.1:8443 (localhost) <—

A record via /etc/hosts
rDNS (127.0.0.1): localhost.
Service detected: HTTP
–> Testing protocols (via sockets except TLS 1.2 and SPDY/NPN)

SSLv2 not offered (OK)
SSLv3 not offered (OK)
TLS 1 not offered
TLS 1.1 not offered
TLS 1.2 offered (OK)
SPDY/NPN not offered

–> Testing ~standard cipher lists

Null Ciphers not offered (OK)
Anonymous NULL Ciphers not offered (OK)
Anonymous DH Ciphers not offered (OK)
40 Bit encryption not offered (OK)
56 Bit encryption Local problem: No 56 Bit encryption configured in /usr/bin/openssl
Export Ciphers (general) not offered (OK)
Low (<=64 Bit) not offered (OK)
DES Ciphers not offered (OK)
Medium grade encryption not offered (OK)
Triple DES Ciphers not offered (OK)
High grade encryption offered (OK)

–> Testing (perfect) forward secrecy, (P)FS — omitting 3DES, RC4 and Null Encryption here

PFS is offered (OK) ECDHE-RSA-AES128-GCM-SHA256 ECDHE-RSA-AES128-SHA256 DHE-RSA-AES128-GCM-SHA256 DHE-RSA-AES128-SHA256

–> Testing server preferences

Has server cipher order? yes (OK)
Negotiated protocol TLSv1.2
Negotiated cipher ECDHE-RSA-AES128-SHA256, 521 bit ECDH
Cipher order
TLSv1.2: ECDHE-RSA-AES128-SHA256 AES128-SHA256 DHE-RSA-AES128-SHA256 ECDHE-RSA-AES128-GCM-SHA256 AES128-GCM-SHA256 DHE-RSA-AES128-GCM-SHA256

–> Testing server defaults (Server Hello)

TLS server extensions renegotiation info
Session Tickets RFC 5077 (none)
Server key size 2048 bit
Signature Algorithm SHA256 with RSA
Fingerprint / Serial SHA1 BCF8947BA3AFD3AF3C0879928177B30AD3596950 / 28CF8FB2
SHA256 9961DA8B9902B767F3D1000FDD35A1D273AC12B3361772CCD0B215C3E658BE7B
Common Name (CN) localhost (works w/o SNI)
subjectAltName (SAN) —
Issuer localhost (Unknown from Unknown)
EV cert (experimental) no
Certificate Expiration >= 60 days (2016-11-25 16:35 –> 2017-02-23 16:35 +0800)
# of certificates provided 1
Chain of trust (experim.) Your /usr/bin/openssl is too old, needed is version >=1.0.2
Certificate Revocation List —
OCSP URI —
OCSP stapling not offered
TLS clock skew -1 sec from localtime
–> Testing HTTP header response @ “/”

HTTP Status Code 200 OK
HTTP clock skew Got no HTTP time, maybe try different URL?
Strict Transport Security —
Public Key Pinning —
Server banner Jetty(9.3.14.v20161028)
Application banner —
Cookie(s) 1 issued: 1/1 secure, NOT HttpOnly
Security headers —
Reverse Proxy banner —
–> Testing vulnerabilities

Heartbleed (CVE-2014-0160) not vulnerable (OK)
CCS (CVE-2014-0224) not vulnerable (OK)
Secure Renegotiation (CVE-2009-3555) not vulnerable (OK)
Secure Client-Initiated Renegotiation not vulnerable (OK)
CRIME, TLS (CVE-2012-4929) not vulnerable (OK)
BREACH (CVE-2013-3587) no HTTP compression (OK) (only supplied “/” tested)
POODLE, SSL (CVE-2014-3566) not vulnerable (OK)
TLS_FALLBACK_SCSV (RFC 7507), experim. Check failed: seems like TLS 1.2 is the only protocol
FREAK (CVE-2015-0204) not vulnerable (OK) (tested with 4/9 ciphers)
LOGJAM (CVE-2015-4000), experimental not vulnerable (OK) (tested w/ 2/4 ciphers only!), common primes not checked. See below for any DH ciphers + bit size
BEAST (CVE-2011-3389) no SSL3 or TLS1
RC4 (CVE-2013-2566, CVE-2015-2808) no RC4 ciphers detected (OK)
–> Testing all locally available 121 ciphers against the server, ordered by encryption strength

Hexcode Cipher Suite Name (OpenSSL) KeyExch. Encryption Bits Cipher Suite Name (RFC)
———————————————————————————————————————–
xc02f ECDHE-RSA-AES128-GCM-SHA256 ECDH 521 AESGCM 128 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
xc027 ECDHE-RSA-AES128-SHA256 ECDH 521 AES 128 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
x9e DHE-RSA-AES128-GCM-SHA256 DH 1024 AESGCM 128 TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
x67 DHE-RSA-AES128-SHA256 DH 1024 AES 128 TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
x9c AES128-GCM-SHA256 RSA AESGCM 128 TLS_RSA_WITH_AES_128_GCM_SHA256
x3c AES128-SHA256 RSA AES 128 TLS_RSA_WITH_AES_128_CBC_SHA256
Done now (2016-11-29 11:54) —> 127.0.0.1:8443 (localhost) <—

Jetty 9.3 Quickstart

Steps to get Jetty up and running:

1) Download the zip from http://download.eclipse.org/jetty

2) Unzip to a location (e.g. /opt/jetty)

3) Define environment variables
export JETTY_HOME=/opt/jetty
export JETTY_BASE=/appl/xxx
export TMPDIR=/appl/xxx/temp

4) Add modules (list of modules can be seen in $JETTY_HOME/modules or –list-modules)
java -jar $JETTY_HOME/start.jar –add-to-startd=http,webapp,deploy,jsp

5) Create a test application and put into $JETTY_BASE/webapps
mkdir -p $JETTY_BASE/webapps/ROOT/WEB-INF
echo “Hello World!” >$JETTY_BASE/webapps/ROOT/index.jsp
echo <<!
<?xml version=’1.0′ encoding=’UTF-8′?>
<web-app xmlns=”http://java.sun.com/xml/ns/javaee&#8221; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; version=”3.0″>
<display-name>TestApp</display-name>
</web-app>
!
>$JETTY_BASE/webapps/ROOT/WEB-INF/web.xml

6) Start Jetty
java -jar $JETTY_HOME/start.jar

7) If everything goes well, can see the application from URL
http://servername:8080

 

Further configurations:

1) Change the listening port and interface in $JETTY_BASE/start.d/http.ini
## Connector host/address to bind to
jetty.http.host=x.x.x.x

## Connector port to listen on
jetty.http.port=8280

2) Add in https module
java -jar $JETTY_HOME/start.jar –add-to-startd=https
cd $JETTY_BASE/etc
keytool -keystore keystore -alias jetty -genkey -keyalg RSA -sigalg SHA256withRSA
Enter keystore password: changeit
What is your first and last name?
[Unknown]: myserver.mydomain.com
What is the name of your organizational unit?
[Unknown]: MyOrgUnit
What is the name of your organization?
[Unknown]: MyOrg
What is the name of your City or Locality?
[Unknown]:
What is the name of your State or Province?
[Unknown]:
What is the two-letter country code for this unit?
[Unknown]:
Is CN=myserver.mydomain.com, OU=MyOrgUnit, O=MyOrgUnit,
L=Unknown, ST=Unknown, C=Unknown correct?
[no]: yes

Enter key password for <jetty>
(RETURN if same as keystore password):

Change $JETTY_BASE/start.d/ssl.ini
## Connector host/address to bind to
jetty.ssl.host=x.x.x.x

## Connector port to listen on
jetty.ssl.port=8543

## Keystore password
jetty.sslContext.keyStorePassword=OBF:1vn21ugu1saj1v9i1v941sar1ugw1vo0

## KeyManager password
jetty.sslContext.keyManagerPassword=OBF:1vn21ugu1saj1v9i1v941sar1ugw1vo0

Note: The obfuscated password can be generated using org.eclipse.jetty.util.security.Password

java -cp $JETTY_HOME/lib/jetty-util-9.3.14.v20161028.jar org.eclipse.jetty.util.security.Password dummy changeit

2016-11-25 16:24:41.933:INFO::main: Logging initialized @186ms
changeit
OBF:1vn21ugu1saj1v9i1v941sar1ugw1vo0
MD5:b91cd1a54781790beaa2baf741fa6789
CRYPT:dujr7UJ/qmJIQ

3) Add in logging module

4) Set up auto-start after Linux reboot
(init.d way)
cp $JETTY_HOME/bin/jetty.sh /etc/init.d/jetty
echo “JETTY_HOME=/opt/jetty” > /etc/default/jetty
echo “JETTY_BASE=/appl/xxx” >> /etc/default/jetty
echo “TMPDIR=/appl/xxx/temp” >> /etc/default/jetty

(systemd way)
Create file /etc/systemd/system/jetty.service

[Unit]
Description=Jetty process
After=multi-user.target

[Service]
Type=simple
User=jetty
Group=jetty
ExecStartPre=/bin/bash –login -c ‘env > /tmp/.jetty-environment-file’
ExecStart=java $JAVA_OPTIONS -jar $JETTY_HOME/start.jar STOP.HOST=localhost STOP.PORT=8115 STOP.KEY=SHUTDOWN STOP.WAIT=30
ExecStop=java -jar $JETTY_HOME/start.jar –stop STOP.HOST=localhost STOP.PORT=8115 STOP.KEY=SHUTDOWN STOP.WAIT=30
EnvironmentFile=-/tmp/.jetty-environment-file
Restart=no

[Install]
WantedBy=multi-user.target

systemctl enable jetty
systemctl daemon-reload

systemctl start jetty
systemctl status jetty -l

systemctl stop jetty
systemctl status jetty -l

 

References:

http://www.eclipse.org/jetty/documentation/current/index.html