Glassfishv41

Patch for https://java.net/jira/browse/GRIZZLY-1720
Chances are, this would have to be applied also against 2.3x and reviewed against master (although master did have the original commit (e54698c) but without the 2nd part (setting request as secure)