Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
IoT Platform
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IoT
IoT Platform
Commits
3c2980ee
Commit
3c2980ee
authored
7 months ago
by
Rodrigo Goncalves
Browse files
Options
Downloads
Patches
Plain Diff
Fix for correct certificate serial size creation
parent
c2b3d382
No related branches found
No related tags found
1 merge request
!15
Resolve "Include scripts to create client certificates in docker image"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docker/certmanager/create-ca.sh
+13
-2
13 additions, 2 deletions
docker/certmanager/create-ca.sh
with
13 additions
and
2 deletions
docker/certmanager/create-ca.sh
+
13
−
2
View file @
3c2980ee
#!/bin/bash
#!/bin/bash
# Caciano Machado/Juliano Zatta - 16/10/2017
cd
/certmanager
cd
/certmanager
.
config
.
config
openssl genpkey
-algorithm
RSA
-out
certificates/rootCA.key
-pkeyopt
rsa_keygen_bits:2048
openssl req
-x509
-new
-nodes
-key
certificates/rootCA.key
-sha256
-days
3650
-out
certificates/rootCA.pem
-subj
"/C=BR/ST=
$STATE
/L=
$CITY
/O=
$ORG
/OU=
$UNIT
/CN=
$HOST
"
-set_serial
"0x
$(
openssl rand
-hex
8
)
"
cd
certificates
\ No newline at end of file
if
[
-a
${
CERTNAME
}
.pem
]
;
then
echo
"WARNING: Certificate with name
$CERTNAME
already exists."
echo
"WARNING: If you really want to delete it then do it manually."
else
ROOTCA_SERIAL
=
`
openssl rand
-hex
8
`
openssl genrsa
-out
${
CERTNAME
}
.key
$KEYSIZE
openssl req
-subj
"/C=BR/ST=
$STATE
/L=
$CITY
/O=
$ORG
/OU=
$UNIT
/CN=Root
\
Certificate"
-x509
-new
-nodes
-key
${
CERTNAME
}
.key
-sha256
-days
$ROOTEXP
-out
${
CERTNAME
}
.pem
-set_serial
"0x
$ROOTCA_SERIAL
"
echo
$ROOTCA_SERIAL
>
rootCA.srl
fi
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment