Package aQute.bnd.url
Class HttpsVerification
- java.lang.Object
-
- aQute.bnd.url.DefaultURLConnectionHandler
-
- aQute.bnd.url.HttpsVerification
-
- All Implemented Interfaces:
Plugin,RegistryPlugin,URLConnectionHandler,Report,Reporter
public class HttpsVerification extends DefaultURLConnectionHandler
TODO Needs testing Can be used to override default verification of HTTPS.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static interfaceHttpsVerification.Config-
Nested classes/interfaces inherited from interface aQute.service.reporter.Report
Report.Location
-
Nested classes/interfaces inherited from interface aQute.service.reporter.Reporter
Reporter.SetLocation
-
-
Field Summary
Fields Modifier and Type Field Description private java.security.cert.X509Certificate[]certificateChainprivate java.lang.StringcertificatesPathprivate javax.net.ssl.SSLSocketFactoryfactory(package private) static org.slf4j.Loggerloggerprivate booleanverify-
Fields inherited from class aQute.bnd.url.DefaultURLConnectionHandler
registry
-
Fields inherited from interface aQute.bnd.service.url.URLConnectionHandler
MATCH
-
-
Constructor Summary
Constructors Constructor Description HttpsVerification()HttpsVerification(java.lang.String certificates, boolean hostnameVerify, Reporter reporter)HttpsVerification(java.security.cert.X509Certificate[] certificateChain, boolean b, Reporter hc)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.util.List<java.security.cert.X509Certificate>createCertificates(java.lang.String paths)static voidgetCertificates(java.lang.String paths, java.util.List<java.security.cert.X509Certificate> certificates)voidhandle(java.net.URLConnection connection)Ensure Https verification is disabled or matches given certificatesprivate voidinit()Initialize the SSL Context and factory.voidsetProperties(java.util.Map<java.lang.String,java.lang.String> map)Set the propertiesjava.lang.StringtoString()-
Methods inherited from class aQute.bnd.url.DefaultURLConnectionHandler
addMatcher, error, exception, getErrors, getLocation, getWarnings, isOk, isPedantic, matches, matches, progress, setRegistry, setReporter, trace, warning
-
-
-
-
Constructor Detail
-
HttpsVerification
public HttpsVerification()
-
HttpsVerification
public HttpsVerification(java.lang.String certificates, boolean hostnameVerify, Reporter reporter)
-
HttpsVerification
public HttpsVerification(java.security.cert.X509Certificate[] certificateChain, boolean b, Reporter hc)
-
-
Method Detail
-
init
private void init() throws java.security.NoSuchAlgorithmException, java.security.KeyManagementException, java.io.FileNotFoundException, java.security.cert.CertificateException, java.io.IOException, java.security.InvalidAlgorithmParameterExceptionInitialize the SSL Context and factory.- Throws:
java.security.NoSuchAlgorithmExceptionjava.security.KeyManagementExceptionjava.io.IOExceptionjava.security.cert.CertificateExceptionjava.io.FileNotFoundExceptionjava.security.InvalidAlgorithmParameterException
-
handle
public void handle(java.net.URLConnection connection) throws java.lang.ExceptionEnsure Https verification is disabled or matches given certificates- Specified by:
handlein interfaceURLConnectionHandler- Overrides:
handlein classDefaultURLConnectionHandler- Parameters:
connection- The connection to modify- Throws:
java.lang.Exception
-
setProperties
public void setProperties(java.util.Map<java.lang.String,java.lang.String> map) throws java.lang.ExceptionSet the properties- Specified by:
setPropertiesin interfacePlugin- Overrides:
setPropertiesin classDefaultURLConnectionHandler- Parameters:
map- attributes and directives for this plugin's clause- Throws:
java.lang.Exception
-
createCertificates
java.util.List<java.security.cert.X509Certificate> createCertificates(java.lang.String paths) throws java.io.FileNotFoundException, java.security.cert.CertificateException, java.io.IOException- Throws:
java.io.FileNotFoundExceptionjava.security.cert.CertificateExceptionjava.io.IOException
-
getCertificates
public static void getCertificates(java.lang.String paths, java.util.List<java.security.cert.X509Certificate> certificates) throws java.security.cert.CertificateException, java.io.IOException- Throws:
java.security.cert.CertificateExceptionjava.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-