Merge "[DMAAP] DMaaP ServiceMesh compatibility"
[oom.git] / kubernetes / common / certInitializer / resources / retrieval / tls_certs_configure.sh
1 #!/bin/sh
2
3 {{/*
4 # Copyright © 2021 Orange
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #       http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 */ -}}
18
19 echo "--- Cert transformation for use with Ingress"
20 echo "*** transform AAF certs into pem files"
21 mkdir -p {{ .Values.credsPath }}/certs
22 keytool -exportcert -rfc -file {{ .Values.credsPath }}/certs/cacert.pem \
23   -keystore {{ .Values.credsPath }}/{{ .Values.fqi_namespace }}.trust.jks \
24   -alias ca_local_0 \
25   -storepass $cadi_truststore_password
26 openssl pkcs12 -in {{ .Values.credsPath }}/{{ .Values.fqi_namespace }}.p12 \
27   -out {{ .Values.credsPath }}/certs/tls.crt -nokeys \
28   -passin pass:$cadi_keystore_password_p12 \
29   -passout pass:$cadi_keystore_password_p12
30 cp {{ .Values.credsPath }}/{{ .Values.fqi_namespace }}.key \
31   {{ .Values.credsPath }}/certs/tls.key
32 echo "--- Done"