-
-
Notifications
You must be signed in to change notification settings - Fork 232
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
Specifying a PEM-encoded self-signed root CA certificate via -cert does not work #908
Comments
@mickaelstrg Hello Sir can i work on this issue ? |
hi @biru-codeastromer, yes, nobody prevents you from working on this I think :) |
@mickaelstrg Okay Sir will work on it. Thanks ! |
Fixes jenkinsci#908 Add handling for the `-cert` parameter in `jenkins-agent` and `jenkins-agent.ps1` scripts. ## jenkins-agent - Add logic to handle the `-cert` parameter by reading the certificate file content. - Update the `exec` command to include the `-cert` parameter if provided. ## jenkins-agent.ps1 - Add logic to handle the `-cert` parameter by reading the certificate file content. - Update the `Start-Process` command to include the `-cert` parameter if provided. ## debian/Dockerfile - Add instructions to copy the certificate file to the container. - Update the `ENTRYPOINT` to include the `-cert` parameter if provided. ## alpine/Dockerfile - Add instructions to copy the certificate file to the container. - Update the `ENTRYPOINT` to include the `-cert` parameter if provided.
Hi @dduportal Sir, I’d like to write the solution to fix the -cert parameter issue. Here’s the plan what I will be doing: 1.Modify the jenkins-agent Script: -Add logic to read the certificate file content when the -cert parameter is provided. -Ensure the certificate content is properly passed to the Java command. 2.Modify the jenkins-agent.ps1 Script: -Add similar logic for the Windows PowerShell script. 3.Update Dockerfiles: -Ensure the certificate file is copied to the container. -Update the ENTRYPOINT to include the -cert parameter if provided. 4.Testing: -Set up a Jenkins controller with a self-signed certificate. -Verify that the agent can connect successfully using the -cert parameter. Let me know if this approach makes sense, and I’ll proceed with the implementation. |
Also I want to express that I will be coming with a follow-up PR for that instead of cluttering in the previous If you give me the green signal . Thanks ! |
Thanks for the plan proposal! It makes sense but I see a few fundamental problems in your proposal:
It might make you change a few things, but your plan looks good for the other steps (at first sight) |
Welcome Sir . Should I implement your improvements and raise the PR ! |
Jenkins and plugins versions report
Environment
What Operating System are you using (both controller, and any agents involved in the problem)?
Agent: Debian 12
Controller: Debian 12
both are running in kubernetes
Reproduction steps
-cert @/etc/ssl/certs/ca-certificates.crt
argument (or-cert $ROOT_CA
by dumping the root CA cert into the ROOT_CA environment variable)Expected Results
Connection via HTTPS to jenkins controller works
Actual Results
Connection via HTTPS to jenkins controller does not work
When using the inbound agent to connect to Jenkins which is setup with a self-signed certificate, I'm using the
-cert
parameter from the agent.jar to specify the path to the root CA certificate that is used to sign the jenkins certificate:Work-around by storing the root CA cert in an environment variable:
Cert is valid:
This looks to me like something makes it that part of the certificate is considered an argument so the parsing does not work as expected.
Anything else?
No response
Are you interested in contributing a fix?
No response
The text was updated successfully, but these errors were encountered: