|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectno.ntnu.vegare.visualizer.client.connection.ConnectionHelper
public class ConnectionHelper
Thread safe singleton implementation by Bill Pugh: http://en.wikipedia.org/wiki/Singleton_pattern
Provides an interface towards the HTTP or HTTPS connection established in the authentication phase. Plain text access can be disabled in the configuration class.
Method Summary | |
---|---|
void |
disableCertificateChainVerification()
This application is likely to be used in a local environment, where certificates are self-signed. |
static ConnectionHelper |
getInstance()
|
HttpsResponse |
request(HttpsRequest req)
Make a HTTPS request, receive a response. |
java.security.cert.X509Certificate |
requestCertificate(java.lang.String url)
Request the certificate from a HTTPS server. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ConnectionHelper getInstance()
public java.security.cert.X509Certificate requestCertificate(java.lang.String url) throws java.io.IOException, javax.net.ssl.SSLException
Request the certificate from a HTTPS server. In this prototype the certificate is not validated, but simply shown to the user as a basic identification effort.
This is not meant as a security measure, but as a usability enhancement. In a production system, proper security should be implemented.
Because no Authorization request property is added, the results will be a 401 error page, which is immediately discarded.
java.io.IOException
- Malformed URL (should be impossible)
or connection timeout
javax.net.ssl.SSLException
- Unverified certificate trust pathpublic HttpsResponse request(HttpsRequest req) throws java.io.IOException
Make a HTTPS request, receive a response. Currently keep-alive is not implemented, thus each request is a separate connection.
java.io.IOException
- Malformed URL, connection timeout or unverified
certificate, if validation is not disabled.public void disableCertificateChainVerification()
This application is likely to be used in a local environment, where certificates are self-signed. Therefore, this class provides a measure to disable chain verification.
Should not be used in a production setting.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |