code: protected Scheme getScheme() {
          String scheme;
          try {
              URI uri = new URI(this.apiUrl);
              scheme = uri.getScheme();
          } catch (URISyntaxException e) {
              scheme = "http";
          }
          if (scheme.equals("https")) {
              return new Scheme(scheme, DEFAULT_HTTPS_PORT, SSLSocketFactory.getSocketFactory());
          } else {
              return new Scheme(scheme, DEFAULT_HTTP_PORT, PlainSocketFactory.getSocketFactory());
          }
      }
docs: Get Scheme Object