@Nullable
    private TlsKeyPair findTlsKeyPair(SslContextMode mode, String hostname) {
        TlsKeyPair tlsKeyPair = tlsProvider.keyPair(hostname);
        if (tlsKeyPair == null) {
            // Try to find the default TLS key pair.
            tlsKeyPair = tlsProvider.keyPair("*");
        }
        if (mode == SslContextMode.SERVER && tlsKeyPair == null) {
            // A TlsKeyPair must exist for a server.
            throw new IllegalStateException("No TLS key pair found for " + hostname);
        }
        return tlsKeyPair;
    }
Returns an {@link SslContext} for the specified {@link SslContextMode} and {@link TlsKeyPair}.
Note that the returned {@link SslContext} should be released via
{@link ReferenceCountUtil#release(Object)} when it is no longer used.
core/src/main/java/com/linecorp/armeria/internal/common/SslContextFactory.java