public static TlsKeyPair ofSelfSigned(String hostname) {
        requireNonNull(hostname, "hostname");
        try {
            final SelfSignedCertificate ssc = new SelfSignedCertificate(hostname);
            return of(ssc.key(), ssc.cert());
        } catch (CertificateException e) {
            throw new IllegalStateException("Failed to create a self-signed certificate for " + hostname, e);
        }
    }
Generates a self-signed certificate for the specified {@code hostname}.
core/src/main/java/com/linecorp/armeria/common/TlsKeyPair.java