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
TODO Needs testing Can be used to override default verification of HTTPS.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface aQute.service.reporter.Report
Report.LocationNested classes/interfaces inherited from interface aQute.service.reporter.Reporter
Reporter.SetLocation -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate X509Certificate[]private Stringprivate SSLSocketFactory(package private) static org.slf4j.Loggerprivate booleanFields inherited from class aQute.bnd.url.DefaultURLConnectionHandler
registryFields inherited from interface aQute.bnd.service.url.URLConnectionHandler
MATCH -
Constructor Summary
ConstructorsConstructorDescriptionHttpsVerification(String certificates, boolean hostnameVerify, Reporter reporter) HttpsVerification(X509Certificate[] certificateChain, boolean b, Reporter hc) -
Method Summary
Modifier and TypeMethodDescription(package private) List<X509Certificate> createCertificates(String paths) static voidgetCertificates(String paths, List<X509Certificate> certificates) voidhandle(URLConnection connection) Ensure Https verification is disabled or matches given certificatesprivate voidinit()Initialize the SSL Context and factory.voidsetProperties(Map<String, String> map) Set the propertiestoString()Methods inherited from class aQute.bnd.url.DefaultURLConnectionHandler
addMatcher, error, exception, getErrors, getLocation, getWarnings, isOk, isPedantic, matches, matches, progress, setRegistry, setReporter, trace, warningMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface aQute.bnd.service.url.URLConnectionHandler
maxConcurrentConnections
-
Field Details
-
logger
static org.slf4j.Logger logger -
factory
-
verify
private boolean verify -
certificatesPath
-
certificateChain
-
-
Constructor Details
-
HttpsVerification
public HttpsVerification() -
HttpsVerification
-
HttpsVerification
-
-
Method Details
-
init
private void init() throws NoSuchAlgorithmException, KeyManagementException, FileNotFoundException, CertificateException, IOException, InvalidAlgorithmParameterExceptionInitialize the SSL Context and factory. -
handle
Ensure Https verification is disabled or matches given certificates- Specified by:
handlein interfaceURLConnectionHandler- Overrides:
handlein classDefaultURLConnectionHandler- Parameters:
connection- The connection to modify- Throws:
Exception
-
setProperties
Set the properties- Specified by:
setPropertiesin interfacePlugin- Overrides:
setPropertiesin classDefaultURLConnectionHandler- Parameters:
map- attributes and directives for this plugin's clause- Throws:
Exception
-
createCertificates
List<X509Certificate> createCertificates(String paths) throws FileNotFoundException, CertificateException, IOException -
getCertificates
public static void getCertificates(String paths, List<X509Certificate> certificates) throws CertificateException, IOException - Throws:
CertificateExceptionIOException
-
toString
-