question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SslContextBuilder Error

See original GitHub issue

java version :1.8 netty version :4.1.75.Final system version :win10


//The default choice is OpenSSL. There is no problem using JDK


    private static SslProvider defaultSslProvider() {
        return OpenSsl.isAvailable() ? SslProvider.OPENSSL : SslProvider.JDK;
    }

       SslContextBuilder sslContext = SslContextBuilder.forServer(cinput, pinput, privateKeyPwd).sslProvider(defaultSslProvider());
        if (ConstConfig.openHttp2) {
            sslContext.ciphers(Http2SecurityUtil.CIPHERS, SupportedCipherSuiteFilter.INSTANCE);
            sslContext.applicationProtocolConfig(selectApplicationProtocolConfig(defaultSslProvider()));
        }

        ConstConfig.sslContext = sslContext.build();

Exception in thread "main" java.lang.NoClassDefFoundError: io/netty/internal/tcnative/CertificateCompressionAlgo
	at io.netty.handler.ssl.SslContext.newServerContextInternal(SslContext.java:473)
	at io.netty.handler.ssl.SslContextBuilder.build(SslContextBuilder.java:606)
	at top.hserver.core.server.util.SslContextUtil.setSsl(SslContextUtil.java:115)
	at top.hserver.core.server.HServer.run(HServer.java:101)
	at top.hserver.HServerApplication.startServer(HServerApplication.java:80)
	at top.hserver.HServerApplication.run(HServerApplication.java:51)
	at com.m3u8.StartApp.main(StartApp.java:10)
Caused by: java.lang.ClassNotFoundException: io.netty.internal.tcnative.CertificateCompressionAlgo
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	... 7 more

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
normanmaurercommented, Mar 16, 2022

Here is your problem:

[INFO] +- io.netty:netty-tcnative-boringssl-static:jar:2.0.41.Final:compile

Use 2.0.50.Final or newer

0reactions
heixiaomacommented, Mar 16, 2022

there must be something wrong with the dependencies… please recheck with mvn

I’ve just re established a project. There’s no problem with testing. It should be my dependence. Thank you for your advice

Read more comments on GitHub >

github_iconTop Results From Across the Web

SSLContextBuilder fails to loadKeyMaterial - Stack Overflow
How to implement an SSL proxy server in Java that overcomes certificate errors in browsers? 2 · JBWEB003006: Handshake failed: java.io.
Read more >
Example usage for org.apache.http.ssl ... - Java2s.com
from w ww .ja v a 2 s. co m * * @param custom The client builder * @return builder with unsafe SSL...
Read more >
org.apache.http.ssl.SSLContextBuilder Java Examples
This page shows Java code examples of org.apache.http.ssl.SSLContextBuilder.
Read more >
org.apache.http.conn.ssl.SSLContextBuilder.<init> java code ...
try { return new SSLContextBuilder().loadTrustMaterial(null ... gse) { throw new RuntimeException("An error occurred setting up the SSLContext", gse); } }.
Read more >
openssl::ssl::SslContextBuilder - Rust - Docs.rs
Configures the certificate verification method for new connections and registers a verification callback. fn set_servername_callback<F>(&mut self, callback: F) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found