Categories: Devops

Setup WSO2 Enterprise Integrator SSL

Nemu dari sini : https://www.extraflow.fr/installer-lets-encrypt-avec-wso2-entreprise-integration-plateforme-debian-jessie/ cuman bahasa prancis

Ikutin step dibawah ini, jalanin manual aja di terminal karena ada command interaktif (untuk masukin password) dan ganti variabel di atas sesuai instalasi anda.

Asumsi file sertifikat berformat pem (seperti lets encrypt)

file sertifiakt = cert.crt
file privat eky = privkey.pem
file chain = chain.pem (bukan fullchain)

#!/bin/bash 

# jks password = wso2carbon

# variable
DOMAIN=<<ISI NAMA DOMAIN ANDA>>
CERTDIR=<<ALAMAT FOLDER YANG BERISI SERTIFIAKT>>
WSO2DIR=<<ALAMAT INSTALASI WSO2EI>>
WSO2KEYDIR=<<$WSO2DIR/repository/resources/security>>

# certificate file name in CERTDIR
CERTFILENAME=cert.crt
KEYFILENAME=privkey.pem
CHAINFILENAME=chain.pem

# backup
cp $WSO2KEYDIR/client-truststore.jks $WSO2KEYDIR/client-truststore.jks.bak.$(date +%s)
cp $WSO2DIR/conf/axis2/axis2.xml $WSO2DIR/conf/axis2/axis2.xml.bak.$(date +%s)
cp $WSO2DIR/conf/tomcat/catalina-server.xml $WSO2DIR/conf/tomcat/catalina-server.xml.bak.$(date +%s)

cd $CERTDIR

# convert crt to jks
openssl pkcs12 -export -in $CERTDIR/$CERTFILENAME -inkey $CERTDIR/$KEYFILENAME -name $DOMAIN -certfile $CERTDIR/$CHAINFILENAME -out $DOMAIN.pfx
keytool -importkeystore -srckeystore $DOMAIN.pfx -srcstoretype pkcs12 -destkeystore $DOMAIN.jks -deststoretype JKS 

# add to client-trustore
keytool -export -alias $DOMAIN -keystore $DOMAIN.jks -file $DOMAIN.pem
keytool -import -alias $DOMAIN -file $DOMAIN.pem -keystore $WSO2KEYDIR/client-truststore.jks

# copy new jks to wso 2
cp $CERTDIR/$DOMAIN.jks $WSO2KEYDIR

# update axis.xml to point the new jks for api
sed "s/wso2carbon.jks/$DOMAIN.jks/g" $WSO2DIR/conf/axis2/axis2.xml

# update catalina-server.xml to point the new jks for carbon management dashboard
sed "s/wso2carbon.jks/$DOMAIN.jks/g" $WSO2DIR/conf/tomcat/catalina-server.xml

# restart wso2
$wso2bin/integrator.sh restart

Herbert Abdillah

Test

Recent Posts

Disk 1 tb sisa 100 gb

Berikut ini detail breakdown nya Docker

7 months ago

Langchain JsonOutputParser Invalid json output Error

Sometimes json output from llm like this : {"key": "value"}``` that langchain JsonOutputParser regex cant…

8 months ago

Tontonan Bagus

https://www.youtube.com/watch?v=ZAqIoDhornk (more…)

8 months ago

Ada Apa Didalam Sistem Operasi (Linux). Apa yang membedakan distribusi Linux seperti Ubuntu, Redhat, Alpine?

#include <stdio.h> int main() { FILE *f_ptr; char f_content[256]; char output[512]; f_ptr = fopen("/tmp/1337", "r");…

11 months ago

Convert OpenSSL 1 in Ruby Gem to OpenSSL 3

Version 3 have different interface Example: https://github.com/herbertabdillah/fabric-gateway-ruby/commit/c7377aaf2e62de1e2ac309965a09b5c7c72a2c7e (more…)

2 years ago

Catatan Belajar Ruby on Rails dari aliran Java dan Php

Telah di edit. Sumber Asli : https://twitter.com/nateberkopec/status/1250603032523370496/photo/1 Ruby on Rails merupakan framework web MVC menggunakan…

3 years ago