private RepositorySystem newRepositorySystem() throws PlexusContainerException, ComponentLookupException {
      if (settings.insecure()) {
        logger.warn("Disabling strict SSL certificate checking!");

        // Create a trust manager that does not validate certificate chains
        TrustManager[] trustAllCerts = new TrustManager[]{
          new X509TrustManager() {
            public java.security.cert.X509Certificate[] getAcceptedIssuers() {
              return new X509Certificate[0];
            }

            public void checkClientTrusted(X509Certificate[] certs, String authType) {}

            public void checkServerTrusted(X509Certificate[] certs, String authType) {}
          }
        };

        try {
          SSLContext sc = SSLContext.getInstance("SSL");
          sc.init(null, trustAllCerts, new java.security.SecureRandom());
          HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
          HttpsURLConnection.setDefaultHostnameVerifier(
            new HostnameVerifier() {
              public boolean verify(String hostname, SSLSession session) {
                return true;
              }
            }
          );
        } catch (GeneralSecurityException e) {
          e.printStackTrace();
        }
      }

      return new DefaultPlexusContainer().lookup(RepositorySystem.class);
    }