code: public Request setSSL(InputStream cerIn, String storePass) {
          this.useSSL = true;
          // LOG.info("--启用Https访问---");
          if (cerIn != null) {
              ByteArrayOutputStream bos = null;
              try {
                  bos = new ByteArrayOutputStream();
                  byte[] buffByte = new byte[1024];
                  int len = -1;
                  while ((len = cerIn.read(buffByte)) > 0) {
                      bos.write(buffByte, 0, len);
                  }
                  bos.flush();
                  this.cerBase64 = new String(Base64.getEncoder().encode(bos.toByteArray()));
              } catch (Exception e) {
                  LOG.error("https访问读取证书文件出错", e);
                  throw new RuntimeException("https访问读取证书文件出错");
              } finally {
                  if (cerIn != null) {
                      try {
                          cerIn.close();
                      } catch (IOException e) {
                          e.printStackTrace();
                      }
                      cerIn = null;
                  }
                  if (bos != null) {
                      try {
                          bos.close();
                      } catch (IOException e) {
                          e.printStackTrace();
                      }
                      bos = null;
                  }
              }
          }
          this.storePass = storePass;
          return this;
      }
docs: /*
  public UnitRequest setSSL(byte[] cerByte, String storePass) { InputStream
  cerIn = new ByteArrayInputStream(cerByte); sslSocketFactory =
  Https.getSslSocketFactory( (cerByte != null && cerByte.length > 0) ? new
  ByteArrayInputStream(cerByte) : null, storePass); return this; }
  
  public UnitRequest setSSL(String cerBase64, String storePass) { byte[]
  cerByte=Base64.getDecoder().decode(cerBase64); setSSL(cerByte,
  storePass); return this; }
  
  public UnitRequest setSSL(InputStream cerIn, String storePass) {
  //sslSocketFactory = Https.getSslSocketFactory(cerIn, storePass); return
  this; }