Skip to content

Commit

Permalink
Fixed not encode certificate header
Browse files Browse the repository at this point in the history
move to chain replaceAll("\t", "\n")
  • Loading branch information
igorRosinskyi authored and tcompiegne committed May 10, 2024
1 parent e8a9c70 commit 7be3e3d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ public static Optional<X509Certificate> extractPeerCertificate(RoutingContext ro
certHeaderValue = certHeaderValue
.replaceAll("\\+","%2F")
.replaceAll("//","%2B")
.replaceAll("=","%3D");
.replaceAll("=","%3D")
.replaceAll("\t", "\n");

certHeaderValue = URLDecoder.decode(certHeaderValue.replaceAll("\t", "\n"), Charset.defaultCharset());
certHeaderValue = URLDecoder.decode(certHeaderValue, Charset.defaultCharset());
CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
certificate = Optional.ofNullable((X509Certificate) certificateFactory.generateCertificate(new ByteArrayInputStream(certHeaderValue.getBytes())));
} catch (CertificateException e) {
Expand Down

0 comments on commit 7be3e3d

Please sign in to comment.