Verify return code: 21 (unable to verify the first certificate)
I have a self-signed certification, I'm using it locally for my API. As you can see in the screenshot is working fine using Docker and Apache for the server side.
The problem is when I tried to use the react App the request fails when I validate the certification using openssl command line, I got the error
Verify return code: 21 (unable to verify the first certificate)
I found some possible solutions but they suggest to use the fullchain which I don't have idea what they are talking about. I only have 2 files, cert and key
Would be amazing if someone can guide me in the right direction for fixing this annoying issue.
Thanks in advance, and let me know if can I provide with more insights.
mac ssl certificate openssl
add a comment |
I have a self-signed certification, I'm using it locally for my API. As you can see in the screenshot is working fine using Docker and Apache for the server side.
The problem is when I tried to use the react App the request fails when I validate the certification using openssl command line, I got the error
Verify return code: 21 (unable to verify the first certificate)
I found some possible solutions but they suggest to use the fullchain which I don't have idea what they are talking about. I only have 2 files, cert and key
Would be amazing if someone can guide me in the right direction for fixing this annoying issue.
Thanks in advance, and let me know if can I provide with more insights.
mac ssl certificate openssl
Use certificate file also as CA certificate and you will get rid of this error.
– Romeo Ninov
Dec 18 '18 at 8:06
Runopenssl x509 -noout -text -in <cert file>
and paste the output into your question.
– garethTheRed
Dec 18 '18 at 19:09
add a comment |
I have a self-signed certification, I'm using it locally for my API. As you can see in the screenshot is working fine using Docker and Apache for the server side.
The problem is when I tried to use the react App the request fails when I validate the certification using openssl command line, I got the error
Verify return code: 21 (unable to verify the first certificate)
I found some possible solutions but they suggest to use the fullchain which I don't have idea what they are talking about. I only have 2 files, cert and key
Would be amazing if someone can guide me in the right direction for fixing this annoying issue.
Thanks in advance, and let me know if can I provide with more insights.
mac ssl certificate openssl
I have a self-signed certification, I'm using it locally for my API. As you can see in the screenshot is working fine using Docker and Apache for the server side.
The problem is when I tried to use the react App the request fails when I validate the certification using openssl command line, I got the error
Verify return code: 21 (unable to verify the first certificate)
I found some possible solutions but they suggest to use the fullchain which I don't have idea what they are talking about. I only have 2 files, cert and key
Would be amazing if someone can guide me in the right direction for fixing this annoying issue.
Thanks in advance, and let me know if can I provide with more insights.
mac ssl certificate openssl
mac ssl certificate openssl
asked Dec 18 '18 at 7:01
Pablo Morales
1014
1014
Use certificate file also as CA certificate and you will get rid of this error.
– Romeo Ninov
Dec 18 '18 at 8:06
Runopenssl x509 -noout -text -in <cert file>
and paste the output into your question.
– garethTheRed
Dec 18 '18 at 19:09
add a comment |
Use certificate file also as CA certificate and you will get rid of this error.
– Romeo Ninov
Dec 18 '18 at 8:06
Runopenssl x509 -noout -text -in <cert file>
and paste the output into your question.
– garethTheRed
Dec 18 '18 at 19:09
Use certificate file also as CA certificate and you will get rid of this error.
– Romeo Ninov
Dec 18 '18 at 8:06
Use certificate file also as CA certificate and you will get rid of this error.
– Romeo Ninov
Dec 18 '18 at 8:06
Run
openssl x509 -noout -text -in <cert file>
and paste the output into your question.– garethTheRed
Dec 18 '18 at 19:09
Run
openssl x509 -noout -text -in <cert file>
and paste the output into your question.– garethTheRed
Dec 18 '18 at 19:09
add a comment |
1 Answer
1
active
oldest
votes
In order to verify a certificate, it must chain all the way to a trust-anchor. openssl
checks this trust-anchor for a keyUsage
extension. If present, it must contain keyCertSign
as a minimum. It turns out that if this extension exists but doesn't contain keyCertSign
it will return error 21.
In addition, your client (openssl s_client
) must know which certificate to use as a trust-anchor. You configure openssl
to use an additional trust-anchor with the -CAfile
option, as follows:
openssl s_client -CAfile <your cert file> -connect api.dev.thetripguru.com:443
1
Hi, I got the same response than using without the cert file
– Pablo Morales
Dec 18 '18 at 9:42
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1385444%2fverify-return-code-21-unable-to-verify-the-first-certificate%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
In order to verify a certificate, it must chain all the way to a trust-anchor. openssl
checks this trust-anchor for a keyUsage
extension. If present, it must contain keyCertSign
as a minimum. It turns out that if this extension exists but doesn't contain keyCertSign
it will return error 21.
In addition, your client (openssl s_client
) must know which certificate to use as a trust-anchor. You configure openssl
to use an additional trust-anchor with the -CAfile
option, as follows:
openssl s_client -CAfile <your cert file> -connect api.dev.thetripguru.com:443
1
Hi, I got the same response than using without the cert file
– Pablo Morales
Dec 18 '18 at 9:42
add a comment |
In order to verify a certificate, it must chain all the way to a trust-anchor. openssl
checks this trust-anchor for a keyUsage
extension. If present, it must contain keyCertSign
as a minimum. It turns out that if this extension exists but doesn't contain keyCertSign
it will return error 21.
In addition, your client (openssl s_client
) must know which certificate to use as a trust-anchor. You configure openssl
to use an additional trust-anchor with the -CAfile
option, as follows:
openssl s_client -CAfile <your cert file> -connect api.dev.thetripguru.com:443
1
Hi, I got the same response than using without the cert file
– Pablo Morales
Dec 18 '18 at 9:42
add a comment |
In order to verify a certificate, it must chain all the way to a trust-anchor. openssl
checks this trust-anchor for a keyUsage
extension. If present, it must contain keyCertSign
as a minimum. It turns out that if this extension exists but doesn't contain keyCertSign
it will return error 21.
In addition, your client (openssl s_client
) must know which certificate to use as a trust-anchor. You configure openssl
to use an additional trust-anchor with the -CAfile
option, as follows:
openssl s_client -CAfile <your cert file> -connect api.dev.thetripguru.com:443
In order to verify a certificate, it must chain all the way to a trust-anchor. openssl
checks this trust-anchor for a keyUsage
extension. If present, it must contain keyCertSign
as a minimum. It turns out that if this extension exists but doesn't contain keyCertSign
it will return error 21.
In addition, your client (openssl s_client
) must know which certificate to use as a trust-anchor. You configure openssl
to use an additional trust-anchor with the -CAfile
option, as follows:
openssl s_client -CAfile <your cert file> -connect api.dev.thetripguru.com:443
edited Dec 18 '18 at 19:59
answered Dec 18 '18 at 8:31
garethTheRed
1,830911
1,830911
1
Hi, I got the same response than using without the cert file
– Pablo Morales
Dec 18 '18 at 9:42
add a comment |
1
Hi, I got the same response than using without the cert file
– Pablo Morales
Dec 18 '18 at 9:42
1
1
Hi, I got the same response than using without the cert file
– Pablo Morales
Dec 18 '18 at 9:42
Hi, I got the same response than using without the cert file
– Pablo Morales
Dec 18 '18 at 9:42
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1385444%2fverify-return-code-21-unable-to-verify-the-first-certificate%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Use certificate file also as CA certificate and you will get rid of this error.
– Romeo Ninov
Dec 18 '18 at 8:06
Run
openssl x509 -noout -text -in <cert file>
and paste the output into your question.– garethTheRed
Dec 18 '18 at 19:09