ATT default cloud user | 809cd89 | 2017-12-07 22:59:02 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
dglFromAtt | 39c8bab | 2018-05-09 21:26:55 -0400 | [diff] [blame] | 3 | # ============LICENSE_START========================================== |
| 4 | # org.onap.dmaap |
| 5 | # =================================================================== |
| 6 | # Copyright © 2018 AT&T Intellectual Property. All rights reserved. |
| 7 | # =================================================================== |
| 8 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 9 | # you may not use this file except in compliance with the License. |
| 10 | # You may obtain a copy of the License at |
| 11 | # |
| 12 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | # |
| 14 | # Unless required by applicable law or agreed to in writing, software |
| 15 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | # See the License for the specific language governing permissions and |
| 18 | # limitations under the License. |
| 19 | # ============LICENSE_END============================================ |
| 20 | # ECOMP is a trademark and service mark of AT&T Intellectual Property. |
| 21 | # |
| 22 | # |
| 23 | |
| 24 | # |
| 25 | # This script adds a known local certificate authority (CA) |
ATT default cloud user | 809cd89 | 2017-12-07 22:59:02 +0000 | [diff] [blame] | 26 | # to be a recognized certificate authority. |
dglFromAtt | 39c8bab | 2018-05-09 21:26:55 -0400 | [diff] [blame] | 27 | # i.e. it updates the truststore |
ATT default cloud user | 809cd89 | 2017-12-07 22:59:02 +0000 | [diff] [blame] | 28 | # |
| 29 | # This script must be run as root. |
| 30 | # |
| 31 | # Works on both CentOS and Ubuntu. |
| 32 | # |
| 33 | set -x |
dglFromAtt | 038b4a4 | 2018-04-24 08:46:34 -0400 | [diff] [blame] | 34 | |
| 35 | # IMPORTANT: use a .crt suffix for update-ca-certificates to work |
| 36 | # |
| 37 | AAFCERT=AAF_RootCA.crt |
| 38 | cat >/tmp/$AAFCERT <<'!EOF' |
ATT default cloud user | 809cd89 | 2017-12-07 22:59:02 +0000 | [diff] [blame] | 39 | -----BEGIN CERTIFICATE----- |
dglFromAtt | 038b4a4 | 2018-04-24 08:46:34 -0400 | [diff] [blame] | 40 | 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 |
| 68 | dYY= |
ATT default cloud user | 809cd89 | 2017-12-07 22:59:02 +0000 | [diff] [blame] | 69 | -----END CERTIFICATE----- |
| 70 | !EOF |
dglFromAtt | 038b4a4 | 2018-04-24 08:46:34 -0400 | [diff] [blame] | 71 | chmod 444 /tmp/$AAFCERT |
ATT default cloud user | 809cd89 | 2017-12-07 22:59:02 +0000 | [diff] [blame] | 72 | if [ -f /etc/redhat-release ] |
| 73 | then |
dglFromAtt | 038b4a4 | 2018-04-24 08:46:34 -0400 | [diff] [blame] | 74 | mv /tmp/$AAFCERT /etc/pki/ca-trust/source/anchors/aafcacert.pem |
ATT default cloud user | 809cd89 | 2017-12-07 22:59:02 +0000 | [diff] [blame] | 75 | update-ca-trust |
| 76 | else |
dglFromAtt | 038b4a4 | 2018-04-24 08:46:34 -0400 | [diff] [blame] | 77 | mv /tmp/$AAFCERT /usr/local/share/ca-certificates/$AAFCERT |
ATT default cloud user | 809cd89 | 2017-12-07 22:59:02 +0000 | [diff] [blame] | 78 | update-ca-certificates |
| 79 | fi |