Skip to content

compressed_certificate support #1909

Open

Description

@swoky

i am using bctls-jdk18on-1.78.1 to create a tls client, but it's not working when the server returned a compressed_certificate,

if i remove compress_certificate(27) from getClientExtensions method, it will be ok.

so the compress_certificate extension is not implemented ?

Activity

  1. swoky commented on Nov 14, 2024

    @swoky
    Author

    i use TlsExtensionsUtils.addCompressCertificateExtension(...) ,just now i checked TlsClientProtocol , found this
    `

        case HandshakeType.certificate_status:
        case HandshakeType.certificate_url:
        case HandshakeType.client_hello:
        case HandshakeType.client_key_exchange:
        case HandshakeType.compressed_certificate:
        case HandshakeType.end_of_early_data:
        case HandshakeType.hello_request:
        case HandshakeType.hello_verify_request:
        case HandshakeType.message_hash:
        case HandshakeType.server_hello_done:
        case HandshakeType.server_key_exchange:
        case HandshakeType.supplemental_data:
        default:
            throw new TlsFatalAlert(AlertDescription.unexpected_message);
    

    `

  2. winne42 commented on Oct 31, 2026

    @winne42
    Contributor

    @dghgit @peterdettman can you confirm this, then this ticket can be closed? Or should it be treated as a feature request?

    Certificate compression (RFC 8879) is not implemented in bctls. 1.78.1 only has the "preliminaries": the constants (ExtensionType.compress_certificate, HandshakeType.compressed_certificate, CertificateCompressionAlgorithm) and helpers to encode and decode the extension (TlsExtensionsUtils.addCompressCertificateExtension etc.). There is no decompression code.

    TlsClientProtocol treats an incoming CompressedCertificate message as illegal and throws TlsFatalAlert(AlertDescription.unexpected_message) (as you have already found out), so the handshake fails.

    BC doesn't send this extension by default, so your getClientExtensions must be adding it. Advertising it tells the server you can accept compressed certificates, and the server may then send one that the client can't process. When you remove it, the server has to send a normal Certificate message, which is why that works.

    The fix is what you already found: don't advertise compress_certificate(27). Compression only reduces handshake size, so you lose nothing functionally. Upgrading won't help, because the current development code doesn't implement it either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    support requestCommunity assistance requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions