Skip to content

Main in the middle certificate generation does not work with Java 25 #3333

@semyon-levin-workato

Description

@semyon-levin-workato

Proposal

WireMock fails with the following exception:

com.github.tomakehurst.wiremock.http.ssl.CertificateGenerationUnsupportedException: Your runtime does not support generating certificates at runtime
	at com.github.tomakehurst.wiremock.http.ssl.CertificateAuthority.generateCertificateAuthority(CertificateAuthority.java:73)
	at com.github.tomakehurst.wiremock.jetty11.SslContexts.buildKeyStore(SslContexts.java:136)
	at com.github.tomakehurst.wiremock.jetty11.SslContexts.buildSslContextFactory(SslContexts.java:85)
	at com.github.tomakehurst.wiremock.jetty11.SslContexts.buildManInTheMiddleSslContextFactory(SslContexts.java:61)
	at com.github.tomakehurst.wiremock.jetty12.Jetty12HttpServer.applyAdditionalServerConfiguration(Jetty12HttpServer.java:150)
	at com.github.tomakehurst.wiremock.jetty.JettyHttpServer.<init>(JettyHttpServer.java:99)
	at com.github.tomakehurst.wiremock.jetty12.Jetty12HttpServer.<init>(Jetty12HttpServer.java:74)
	at com.github.tomakehurst.wiremock.jetty12.Jetty12HttpServerFactory.buildHttpServer(Jetty12HttpServerFactory.java:33)
	at com.github.tomakehurst.wiremock.WireMockServer.<init>(WireMockServer.java:75)
    [... our code ...]
 [73 skipped]
Caused by: java.lang.IllegalAccessError: class com.github.tomakehurst.wiremock.http.ssl.CertificateAuthority (in unnamed module @0x30f39991) cannot access class sun.security.x509.KeyIdentifier (in module java.base) because module java.base does not export sun.security.x509 to unnamed module @0x30f39991
	at com.github.tomakehurst.wiremock.http.ssl.CertificateAuthority.certificateAuthorityExtensions(CertificateAuthority.java:88)
	at com.github.tomakehurst.wiremock.http.ssl.CertificateAuthority.generateCertificateAuthority(CertificateAuthority.java:58)
	... 84 common frames omitted

Reproduction steps

We use wiremock-jetty12 version 3.13.2

We start WireMock like this:

var config = WireMockConfiguration.wireMockConfig()
    .dynamicPort()
    .enableBrowserProxying(true);
var server = new WireMockServer(config);
server.start();

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions