code: static long toBIO(ByteBufAllocator allocator, X509Certificate... certChain) throws Exception {
          if (certChain == null) {
              return 0;
          }
  
          if (certChain.length == 0) {
              throw new IllegalArgumentException("certChain can't be empty");
          }
  
          PemEncoded pem = PemX509Certificate.toPEM(allocator, true, certChain);
          try {
              return toBIO(allocator, pem.retain());
          } finally {
              pem.release();
          }
      }
docs: Return the pointer to a <a href="https://www.openssl.org/docs/crypto/BIO_get_mem_ptr.html">in-memory BIO</a>
  or {@code 0} if the {@code certChain} is {@code null}. The BIO contains the content of the {@code certChain}.