How can I obtain a copy of the public certificate my ldaps server is using?
search cancel

How can I obtain a copy of the public certificate my ldaps server is using?

book

Article ID: 410400

calendar_today

Updated On:

Products

Network Observability CA Performance Management Spectrum

Issue/Introduction

I need to update the configuration with a new ldaps certificate, how can I get the certificate to do so?

Resolution

The following call can be used to create the certificate as ldap_server_cert.pem within the working directory.

Note: You must update the <hostname> variable to the hostname of your ldaps server and <port> to the port of your ldaps server

 

echo "" | openssl s_client -connect <hostname>:<port> -showcerts 2>/dev/null | awk '/-----BEGIN CERTIFICATE-----/{flag=1}/-----END CERTIFICATE-----/{print;flag=0}flag' | sed -n '1,/-----END CERTIFICATE-----/p' > ldap_server_cert.pem