Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why certificate chain does not pass verification #93

Open
sergey-msignia opened this issue Dec 3, 2024 · 0 comments
Open

Why certificate chain does not pass verification #93

sergey-msignia opened this issue Dec 3, 2024 · 0 comments

Comments

@sergey-msignia
Copy link

I have certificate chain what successfully passes verification in function wrote on java and C also the chain passes verification in tool https://tools.keycdn.com/ssl, but the same function but wrote with @peculiar/x509 library indicates that the certificate chain does not pass verification. Can you please help to understand why the chain does not pass verification using the library and where is the issue?

Here is certificate chain:
-----BEGIN CERTIFICATE-----
MIIFBTCCAu2gAwIBAgIISSmcGADu4sswDQYJKoZIhvcNAQEMBQAwgYMxCzAJBgNV
BAYTAlVTMQswCQYDVQQIEwJUTjEQMA4GA1UEChMHTVNJR05JQTEMMAoGA1UECxMD
Uk5EMSQwIgYDVQQDExtNU0lHTklBIFJORCBJTlRFUk1FRElBVEUgQ0ExITAfBgkq
hkiG9w0BCQEWEmRldm9wc0Btc2lnbmlhLmNvbTAeFw0yNDExMTgxNTI0MDBaFw0y
OTExMTMwMDM2MDBaMIGCMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVE4xEDAOBgNV
BAoTB01TSUdOSUExFDASBgNVBAsTC01TSUdOSUEgUk5EMRswGQYDVQQDExJhY3Mu
dHAubXNpZ25pYS5jb20xITAfBgkqhkiG9w0BCQEWEmRldm9wc0Btc2lnbmlhLmNv
bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAI/mcoe6dRRn7ZLIqg5R
Ebo4OTOciZ9xc1UFOVXbj0WyYzhTbLvg5YoQ3GSycL6WTQAJb8U4OjEX4vkTqBgs
jrUX13wBeqp33nu0w4oDG3P/gSjcuoyjAWTmXPvu7aZwWfynZ9WNEB8KtTa8G7W9
P2rHArASYZNqr/ApocNESd2Qwi53c7n0KXJoyf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QkB
FhdwYXZsby5seXNvdkBtc2lnbmlhLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEP
ADCCAQoCggEBAPSn+PdwUVXYq5IQN+vrcxM3WfR5Xpgb3OpIRkka863duH0j3Uh/
poaFxnp/j0dGbefYaKaXGZSFX/E3FWaAFGKHV2Lbt4uxYkJx4Fa2gXsBxqdOd4Li
aqSRSZXPtYMqoMbCOQj4lqtthBNe5BDX6/1HDJELLo8sxnIyfwxgbome3s9e6Rpz
p+M9XgOtfyuSzPhzY0bWeBrHDzPcKkxQgKZeywlgApCPPfoYEvBDfzGbNns4yA+v
sqYGDcctplQceUG6EFN68qbmy3CzV8zQMHFkHqIJ/l1V5RlGT9b5QhNVhu4MJo//
W8LaA6vdyyqPnS7Hbvp6JklkMVxJJhWl0t8CAwEAAaNyMHAwDwYDVR0TAQH/BAUw
AwEB/zAdBgNVHQ4EFgQU443mM7cesLlNiq01jfVfyJ7Rh1gwCwYDVR0PBAQDAgEG
MBEGCWCGSAGG+EIBAQQEAwIABzAeBglghkgBhvhCAQ0EERYPeGNhIGNlcnRpZmlj
YXRlMA0GCSqGSIb3DQEBCwUAA4IBAQBOY7ETJ0MyrQ44MYNbkGI7fIij5oxM0In0
Z4ZT5NCA1p3fJP/PV8oxONE+7ix1GlCw8RR59L2VQGkg4I2vSj0DHqpuPf3u86Fm
gZtkhcF41dlWSic1B5oaA610iglITgu/gyZrC+r6RHGIKfyLX+u8YGc6WfI8g/ED
aVQcnq/PZAEeZtBGiZdYxnIQhIOxV04nFmtOjSyyMt5NXMHFLHRnewSI6tojcFm2
lm6WMZQXFqGyvkxjmPQXFFBCupAAPIkm0lIIvZqtvLOOqmU7et4Oy5pihyaHjg67
cdmlv/p990e7YYfzdQSKezWrdwXW4EAGBTyuAZ67a5XCOUi17JZU
-----END CERTIFICATE-----

For parsing certificate in JS is used:
new x509.X509Certificate(certificate);

For verifying certificates in JS is used:
const isVerified = await certA.verify({ date: new Date(), publicKey: await certB.publicKey.export() });

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant