Skip to content

Commit

Permalink
fix certificate adjacency list logging with java.net.http client
Browse files Browse the repository at this point in the history
The SSLHandshakeException is wrapped in an IOException
  • Loading branch information
Adam- committed Mar 12, 2024
1 parent 602ae31 commit 6edc722
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions src/main/java8/net/runelite/launcher/CertPathExtractor.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*/
package net.runelite.launcher;

import javax.net.ssl.SSLHandshakeException;
import sun.security.provider.certpath.AdjacencyList;
import sun.security.provider.certpath.SunCertPathBuilderException;
import sun.security.validator.ValidatorException;
Expand All @@ -33,22 +32,12 @@ class CertPathExtractor
{
static String extract(Throwable ex)
{
// IOException -> SSLHandshakeException -> ValidatorException -> SunCertPathBuilderException
try
{
if (ex instanceof SSLHandshakeException)
{
ex = ex.getCause();
if (ex instanceof ValidatorException)
{
ex = ex.getCause();
if (ex instanceof SunCertPathBuilderException)
{
SunCertPathBuilderException pathBuilderEx = (SunCertPathBuilderException) ex;
AdjacencyList adjList = pathBuilderEx.getAdjacencyList();
return adjList.toString();
}
}
}
SunCertPathBuilderException pathBuilderEx = (SunCertPathBuilderException) ex.getCause().getCause().getCause();
AdjacencyList adjList = pathBuilderEx.getAdjacencyList();
return adjList.toString();
}
catch (Throwable ex_)
{
Expand Down

0 comments on commit 6edc722

Please sign in to comment.