File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
grype/db/v5/distribution/test-fixtures/tls Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
set -eux
3
3
4
+ # we want to still use this on systems where there could be invalid characters in the hostname (e.g. ' or " characters)
5
+ HOSTNAME=$( hostname | sed " s/['']/'/g" | sed ' s/[^a-zA-Z0-9.-]/-/g' )
6
+
4
7
# create private key
5
8
openssl genrsa -out server.key 2048
6
9
@@ -11,6 +14,5 @@ openssl req -new -x509 -sha256 \
11
14
-days 3650 \
12
15
-reqexts SAN \
13
16
-extensions SAN \
14
- -config <( cat /etc/ssl/openssl.cnf <( printf " [SAN]\nsubjectAltName=DNS:$( hostname) .local" ) ) \
15
- -subj " /C=US/ST=Test/L=Test/O=Test/CN=$( hostname) .local"
16
-
17
+ -config <( cat /etc/ssl/openssl.cnf <( printf " [SAN]\nsubjectAltName=DNS:$HOSTNAME .local" ) ) \
18
+ -subj " /C=US/ST=Test/L=Test/O=Test/CN=$HOSTNAME .local"
You can’t perform that action at this time.
0 commit comments