[2.3.x] + fix glassfish issue GLASSFISH-21118
https://java.net/jira/browse/GLASSFISH-21118
"NullPointerException using https"