Showing posts with label ssl. Show all posts
Showing posts with label ssl. Show all posts

Wednesday, December 18, 2024

Renew letsencrypt ssl certificate for zimbra 8.8.15


 Letsencrypt certs usually consists of these files:

1. cert.pem

2. chain.pem

3. fullchain.pem

4. privkey.pem


I am not going to discuss about how you get those files from letsencrypt. This is for how to renew ssl cert for zimbra specifically version 8.8.15 GA 4717 that i am using. It may or may not work for previous or later version. YMMV

Put the folder containing the certs in /opt/zimbra. Let's say directory named letsencrypt. Make sure it owns by zimbra. 

Step 1:

Download letsencrypt root cert here to the same folder as those letsencrypt certs above. The file name is isrgrootx1.pem.

Step 2:

run this: cat isrgrootx1.pem >> chain.pem

Step 3:

Verify the certs using zmcrtmgr. Run the command as user zimbra. The output as following:

zmcertmgr verifycrt comm privkey.pem cert.pem chain.pem  
** Verifying 'cert.pem' against 'privkey.pem'
Certificate 'cert.pem' and private key 'privkey.pem' match.
** Verifying 'cert.pem' against 'chain.pem'
Valid certificate chain: cert.pem: OK

Step 4: 

If step 3 above is ok. Deploy the certs (asa user zimbra)

zmcertmgr deploycrt comm  cert.pem chain.pem


Step 5: 

If step above is successful. Restart the services (as user zimbra):

zmcontrol restart


If there's no error. Your zimbra's ssl is renewed successfully.


Saturday, December 30, 2017

Setup SSL for Jira

How to do it...

Perform the following steps to import an SSL certificate:

1. Open up a command window and go to the directory where the certificate file
resides.

2. Generate a Java KeyStore (JKS) for JIRA by running the

keytool -genkey -alias jira -keyalg RSA -keystore /opt/jks/jira.jks

3. Import the certificate into KeyStore repository
keytool -import -alias jira -keystore JIRA_INSTALL/jira.jks -file file.crt

where file.crt is the certificate file.

4. Open the server.xml file located in the /opt/atlassian/jira/conf directory in a text editor.

5. Locate and uncomment the following XML configuration snippet:

maxThreads="150"
minSpareThreads="25" maxSpareThreads="75"
enableLookups="false"
disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
clientAuth="false"
sslProtocol="TLS" useBodyEncodingForURI="true"

keystoreFile="/opt/jks/jira.jks"
keystorePass="mypassword"
keyAlias="jira"
keystoreType="JKS"/>




Letsencrypt

Install certbot ppa:

sudo add-apt-repository ppa:certbot/certbot

then install certbot:
sudo apt install certbot


 run certbot for manual installation of letsencrypt using challenge via DNS:

sudo certbot certonly --manual --preferred-challenges dns

openssl pkcs12 -export -in fullchain1.pem -inkey privkey1.pem -out cert_and_key.p12 -name tomcat -CAfile chain1.pem -caname root

keytool -importkeystore -srcstorepass ppz2017 -deststorepass ppz2017 
-destkeypass ppz2017 -srckeystore jira.siza.my/cert_and_key.p12 
-srcstoretype PKCS12 -alias tomcat 
-keystore jira.jks

TO see what contains in the keystore:
keytool -list -keystore /opt/jks/jira.jks

6. Restart JIRA to apply the changes.
sudo systemctl stop jira
sudo systemctl start jira



Monday, May 16, 2016

Installing thawte SSL cert in Zimbra 8.6.0

1. Create csr and keep your key file. Copy the key file to /opt/zimbra/ssl/zimbra/commercial/commercial.key
2. Give or upload your csr file to certificate provider
3. Get certificate given by your cert provider after your csr is accepted.
4. Get the root certificate of your provider. For thawte, mine is here
5. Get intermediate certificate. Mine is here
6. Combine the content of the root and intermediate cert files e.g cat intermediate.crt root.crt > commercial_ca.crt and copy it to dir /opt/zimbra/ssl/zimbra/commercial

Below is the steps to verify that the certificates are ok and ready to deploy. You can skip the first step if you have already create the csr.

Single-Node Commercial Certificate

We need to take care and ask for the Certificate authority for the Root and Intermediate Keys, we will need it soon.
We will use at least 2048-bit key, is the minimum for all Certificate Authorities: 1. Begin by generating a Certificate Signing Request (CSR).
/opt/zimbra/bin/zmcertmgr createcsr comm -new -subject "/C=US/ST=CA/L=Sunnyvale/O=Zimbra/OU=Zimbra Collaboration Suite/CN=host.example.com" -subjectAltNames host.example.com
2. Next, submit the CSR to the SSL provider and get a commercial certificate in PEM format. Save the new certificate to a temporary file (e.g. /tmp/commercial.crt).
3. Now, download and save the root Certificate Authority (CA) from your provider to a temporary file. (e.g. /tmp/ca.crt)
4. Download any intermediary CAs from your provider to a temporary file. (e.g. /tmp/ca_intermediary.crt)
5. Combine root and intermediary CAs into a temporary file.
cat /tmp/ca_intermediary.crt /tmp/ca.crt > /tmp/ca_chain.crt
6. Verify your commercial certificate.
/opt/zimbra/bin/zmcertmgr verifycrt comm /opt/zimbra/ssl/zimbra/commercial/commercial.key /tmp/commercial.crt /tmp/ca_chain.crt
**Verifying /tmp/commercial.crt against
/opt/zimbra/ssl/zimbra/commercial/commercial.key
Certificate (/tmp/commercial.crt) and private key
(/opt/zimbra/ssl/zimbra/commercial/commercial.key) match.
Valid Certificate: /tmp/commercial.crt: OK
7. Deploy your commercial certificate.
/opt/zimbra/bin/zmcertmgr deploycrt comm /tmp/commercial.crt /tmp/ca_chain.crt
** Verifying /tmp/commercial.crt against
/opt/zimbra/ssl/zimbra/commercial/commercial.key
Certificate (/tmp/commercial.crt) and private key
(/opt/zimbra/ssl/zimbra/commercial/commercial.key) match.
Valid Certificate: /tmpt/commercial.crt: OK
**Copying commercial.crt to /opt/zimbra/ssl/zimbra/commercial/commercial.crt
**Appending CA chain /tmp/ca_chain.crt to
/opt/zimbra/ssl/zimbra/commercial/commercial.crt
**Saving server config key zimbraSSLCeretificate…done.
**Saving server config key zimbraSSLPrivateKey…done.
**Installing mta certificate and key…done.
**Installing slapd certificate and key…done.
**Installing proxy certificate and key…done.
**Creating pkcs12 file /opt/zimbra/ssl/zimbra/jetty.pkcs12…done.
**Creating keystore file /opt/zimbra/mailbox/etc/keystore…done.
**Installing CA to /opt/zimbra/conf/ca…done.
If you get error "unable to get issuer certificate, please look at the steps in the link below.
https://wiki.zimbra.com/wiki/Fix_depth_lookup:unable_to_get_issuer_certificate

Nvidia new hotplug feature on Linux

 If you use nvidia driver for your GPU, you probably wonder why in some config, you can't hotplug your second monitor. You need to reboo...