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.Location
Nested classes/interfaces inherited from interface aQute.service.reporter.Reporter
Reporter.SetLocation
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate X509Certificate[]
private String
private SSLSocketFactory
(package private) static org.slf4j.Logger
private boolean
Fields inherited from class aQute.bnd.url.DefaultURLConnectionHandler
registry
Fields 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 void
getCertificates
(String paths, List<X509Certificate> certificates) void
handle
(URLConnection connection) Ensure Https verification is disabled or matches given certificatesprivate void
init()
Initialize the SSL Context and factory.void
setProperties
(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, warning
-
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:
handle
in interfaceURLConnectionHandler
- Overrides:
handle
in classDefaultURLConnectionHandler
- Parameters:
connection
- The connection to modify- Throws:
Exception
-
setProperties
Set the properties- Specified by:
setProperties
in interfacePlugin
- Overrides:
setProperties
in 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:
CertificateException
IOException
-
toString
-