How to add SSL self-signed certificate to Jenkins for LDAPS in Dockerfile?


case

I want to enable LDAPS under security in Jenkins, but my LDAP server has a self-signed CERT. Has anyone done this or have some pointers on this? do i have to use keytool?

In my Dockerfile, I'm trying the following, but it doesn't work:

FROM jenkins

USER root

# Install CA certs
COPY ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
RUN chmod +r /etc/ssl/certs/ca-certificates.crt

# Install the Jenkins plugin  
COPY plugins.txt /usr/share/jenkins/plugins.txt
RUN /usr/local/bin/plugins.sh /usr/share/jenkins/plugins.txt

# Expose container port 33838 for Jenkins UDP-based auto-discovery
EXPOSE 33848/udp

ENV JAVA_OPTS -Xmx2048m
case

It turns out that I just had to add this in the Dockerfile, where ldap.cer is the certificate chain for my self-signed certificate.

COPY ldap.cer $JAVA_HOME/jre/lib/security
RUN \
    cd $JAVA_HOME/jre/lib/security \
    && keytool -keystore cacerts -storepass changeit -noprompt -trustcacerts -importcert -alias ldapcert -file ldap.cer

Related


How to add self signed ssl certificate for loopback4?

Kevin I'm working on a microservice project based on loopback-next (loopback4), it's a simple service, so I want the application as an SSL endpoint. But I can't find any guide/documentation or example on how to configure SSL in lb4 generated code. Does anyone

How to add self signed ssl certificate for loopback4?

Kevin I'm working on a microservice project based on loopback-next (loopback4), it's a simple service, so I want the application as an SSL endpoint. But I can't find any guide/documentation or example on how to configure SSL in lb4 generated code. Does anyone

Verify self-signed certificate for LDAPS connection

Anant Gupta I want to establish a secure ldap connection (ldaps) from a Linux (Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux) client to a Windows 2012 server to change user passwords while active directory, via php. For this, I created a self-sig

PrincipalContext LDAPS self-signed certificate

BMW We have an application that uses LDAP to authenticate to a remote AD via LDAP over a VPN tunnel by IP address, using the following code: using (PrincipalContext pc = new PrincipalContext(ContextType.Domain, ldap.Host, ldap.Path.Replace("/", ""), ContextOpt

PrincipalContext LDAPS self-signed certificate

BMW We have an application that uses LDAP to authenticate to a remote AD via LDAP over a VPN tunnel by IP address, using the following code: using (PrincipalContext pc = new PrincipalContext(ContextType.Domain, ldap.Host, ldap.Path.Replace("/", ""), ContextOpt

PrincipalContext LDAPS self-signed certificate

BMW We have an application that uses LDAP to authenticate to a remote AD via LDAP over a VPN tunnel by IP address, using the following code: using (PrincipalContext pc = new PrincipalContext(ContextType.Domain, ldap.Host, ldap.Path.Replace("/", ""), ContextOpt

Verify self-signed certificate for LDAPS connection

Anant Gupta I want to establish a secure ldap connection (ldaps) from a Linux (Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux) client to a Windows 2012 server to change user passwords while active directory, via php. For this, I created a self-sig

Verify self-signed certificate for LDAPS connection

Anant Gupta I want to establish a secure ldap connection (ldaps) from a Linux (Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux) client to a Windows 2012 server to change user passwords while active directory, via php. For this, I created a self-sig

Verify self-signed certificate for LDAPS connection

Anant Gupta I want to establish a secure ldap connection (ldaps) from a Linux (Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux) client to a Windows 2012 server to change user passwords while active directory, via php. For this, I created a self-sig

PrincipalContext LDAPS self-signed certificate

BMW We have an application that uses LDAP to authenticate to a remote AD via LDAP over a VPN tunnel by IP address, using the following code: using (PrincipalContext pc = new PrincipalContext(ContextType.Domain, ldap.Host, ldap.Path.Replace("/", ""), ContextOpt

PrincipalContext LDAPS self-signed certificate

BMW We have an application that uses LDAP to authenticate to a remote AD via LDAP over a VPN tunnel by IP address, using the following code: using (PrincipalContext pc = new PrincipalContext(ContextType.Domain, ldap.Host, ldap.Path.Replace("/", ""), ContextOpt

How to create a self-signed SSL certificate?

Stefano Palazzo I have set up SSL on the webserver and now need two files: Certificate certificate key How to create a self-signed certificate for testing purposes? Stefano Palazzo Ubuntu, even the "minimal" flavor, comes with ssl-certpackages pre-installed, w

How to create a self-signed SSL certificate?

Stefano Palazzo I have set up SSL on the webserver and now need two files: Certificate certificate key How to create a self-signed certificate for testing purposes? Stefano Palazzo Ubuntu, even the "minimal" flavor, comes with ssl-certpackages pre-installed, w

How to create a self-signed SSL certificate?

Stefano Palazzo I have set up SSL on the webserver and now need two files: Certificate certificate key How to create a self-signed certificate for testing purposes? Stefano Palazzo Ubuntu, even the "minimal" flavor, comes with ssl-certpackages pre-installed, w