How to add a SSL self-signed cert to Jenkins for LDAPS within Dockerfile?

前端 未结 3 2080
再見小時候
再見小時候 2020-12-09 11:05

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 doing this? Do I have to use keytoo

相关标签:
3条回答
  • 2020-12-09 11:27

    Run keytool to import the CA cert into your java keystore.

    See:

    telling java to accept self-signed ssl certificate

    0 讨论(0)
  • 2020-12-09 11:32

    It turns out I just need to add this in the Dockerfile where ldap.cer is the cert chain for my self-signed cert.

    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
    
    0 讨论(0)
  • 2020-12-09 11:38

    On our build server with jenkins, nexus and sonarqube we use a extracted and prepared cacerts file on the host using a start parameter for docker run.

    See my answer on Stackoverflow "Importing self-signed cert into Docker's JRE cacert is not recognized by the service"

    0 讨论(0)
提交回复
热议问题