Skip to content

Commit

Permalink
Fix ocsp server example bug (netty#13223)
Browse files Browse the repository at this point in the history
Motivation:

io.netty.example.ocsp.OcspUtils#ocspUri always return null, because of the wrong class type.

Modification:

change DERTaggedObject class to DLTaggedObject class

Result:
fix the ocsp server bug, so the server now can successfuly get the url of the issuer.

Co-authored-by: mipengcheng <[email protected]>
  • Loading branch information
EvanMi and mipengcheng authored Feb 17, 2023
1 parent 4a74cdc commit ebb30db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions example/src/main/java/io/netty/example/ocsp/OcspUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.BERTags;
import org.bouncycastle.asn1.DERTaggedObject;
import org.bouncycastle.asn1.DLTaggedObject;
import org.bouncycastle.asn1.DLSequence;
import org.bouncycastle.asn1.x509.Extension;
import org.bouncycastle.cert.ocsp.OCSPReq;
Expand Down Expand Up @@ -72,7 +72,7 @@ public static URI ocspUri(X509Certificate certificate) throws IOException {
}

DLSequence aiaSequence = (DLSequence) authorityInfoAccess;
DERTaggedObject taggedObject = findObject(aiaSequence, OCSP_RESPONDER_OID, DERTaggedObject.class);
DLTaggedObject taggedObject = findObject(aiaSequence, OCSP_RESPONDER_OID, DLTaggedObject.class);
if (taggedObject == null) {
return null;
}
Expand Down

0 comments on commit ebb30db

Please sign in to comment.