Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

WebObjects/Web Applications/Development/SSL

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Detecting SSL Code for detecting whether SSL is active for the current request: I'm told this won't work with IIS: // Is this page being accessed securely? boolean secureMode = false; String header = context.request().headerForKey("https"); if( header == null ) { log.debug( "no https header, looking for server_port" ); header = context.request().headerForKey( "server_port" ); if( header == null ) { log.debug( "no server_port header found, assuming insecure connection" ); } else { log.debug( "server_port header found, using it" ); secureMode = header.equals( "443" ); } } else { log.debug( "https header found, using it" ); secureMode = header.equals( "on" ); } log.debug( "secure mode set to " + secureMode );