Package aQute.bnd.url

Class HttpsVerification

  • All Implemented Interfaces:
    Plugin, RegistryPlugin, URLConnectionHandler, aQute.service.reporter.Report, aQute.service.reporter.Reporter

    public class HttpsVerification
    extends DefaultURLConnectionHandler
    TODO Needs testing Can be used to override default verification of HTTPS. The 'trusted' property on this plugin must contain a list of issuer certificates that are trusted. If none are specified the verification is NOT done.
    • Constructor Detail

      • HttpsVerification

        public HttpsVerification()
      • HttpsVerification

        public HttpsVerification​(java.lang.String certificates,
                                 boolean hostnameVerify,
                                 aQute.service.reporter.Reporter reporter)
      • HttpsVerification

        public HttpsVerification​(java.security.cert.X509Certificate[] certificateChain,
                                 boolean b,
                                 aQute.service.reporter.Reporter hc)
    • Method Detail

      • handle

        public void handle​(java.net.URLConnection connection)
                    throws java.lang.Exception
        Ensure Https verification is disabled or matches given certificates
        Specified by:
        handle in interface URLConnectionHandler
        Overrides:
        handle in class DefaultURLConnectionHandler
        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.Exception
        Set the properties
        Specified by:
        setProperties in interface Plugin
        Overrides:
        setProperties in class DefaultURLConnectionHandler
        Parameters:
        map - attributes and directives for this plugin's clause
        Throws:
        java.lang.Exception
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object