-
Notifications
You must be signed in to change notification settings - Fork 87
[Question] semantic release GitLab error when self signed certificates are used. #725
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
Comments
Have a look here #568. Might be the same reason |
@JonasSchubert Thanks for the reference. |
#489 (comment) this flag might help you |
You might have to change NODE_OPTION to NODE_OPTIONS in your variables |
Thank you for spotting, but just tested only NODE_OPTIONS in 13.0.1 and 10.1.4 and both are giving UNABLE_TO_GET_ISSUER_CERT unless NODE_TLS_REJECT_UNAUTHORIZED: 0 is used for version 10.1.4 |
Did you try this approach: #489 (comment)
|
Yes, this is exactly what I am doing: Docker image:
Than env is added to the gitlab variables like: Versions checked:
Certs are valid because other tools are ok to use them. So far only NODE_TLS_REJECT_UNAUTHORIZED: 0 and version 10.1.4 works. |
You need to force Node to use the system certificate store, see #489 (comment) |
@fgreinacher Node options are set. |
@ievgennaida Can you share a minimal project that reproduces this issue? That would help a lot. |
Hi @ievgennaida, I see you reached out to sindresorhus/got. Did you manage to find a solution? |
Hello @JonasSchubert, unfortunately no, only old version works and issue was postponed. |
Somehow env variables as NODE_TLS_REJECT_UNAUTHORIZED are definitely not hitting a Got library. Next workaround can be used to keep rejectUnauthorized and use the latest gitlab lib plugin version: respect-env.js -> plugin to run before this plugin
Semantic Config:
P.s. please avoid using that, you have to find out why certs are not working fine |
Thanks @ievgennaida , this work around works for me. I tried the "--use-openssl-ca" method but failed. And for people meet the same issue, here are my configurations. .gitlab-ci.yml release:
stage: release
image: node:lts
variables:
NODE_TLS_REJECT_UNAUTHORIZED: 0
script:
- yarn add https semantic-release @semantic-release/gitlab @semantic-release/changelog @semantic-release/git
- git config http.sslVerify false
- npx semantic-release
rules:
- if: $CI_COMMIT_BRANCH == "main" && $CI_PIPELINE_SOURCE == "push" .releaserc.json {
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"./ci-plugin.cjs",
"@semantic-release/gitlab"
]
} ci-plugin.cjs const https = require("https");
module.exports = {
// Called during verifyConditions step
verifyConditions: async (_, context) => {
context.logger.log("Ensure env variable is respected");
https.globalAgent.options.rejectUnauthorized =
process.env.NODE_TLS_REJECT_UNAUTHORIZED != "0";
},
}; |
I am not able to use self-signed certificates using this plugin.
Version: "@semantic-release/gitlab": "13.1.0",
Error:
UNABLE_TO_GET_ISSUER_CERT
I have tried to set next variables:
Certs are installed in the container
Error:
I would appreciate any suggestion how to use self-signed certificates.
The text was updated successfully, but these errors were encountered: