Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CaosDB Python Integration Tests
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
CaosDB Python Integration Tests
Commits
a821d48e
Verified
Commit
a821d48e
authored
2 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
update cert.sh file
parent
f71338e8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#30012
failed
2 years ago
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.docker/cert.sh
+13
-4
13 additions, 4 deletions
.docker/cert.sh
tests/test_tickets.py
+2
-6
2 additions, 6 deletions
tests/test_tickets.py
with
15 additions
and
10 deletions
.docker/cert.sh
+
13
−
4
View file @
a821d48e
...
...
@@ -26,11 +26,15 @@
# The hostname for which the certificate is created can be changed by setting
# the environment variable CAOSHOSTNAME.
#
# Any arguments will be passed on to `keytool`, you can use this for example for the
# `-noprompt` option.
#
# ## Overview of variables ##
#
# - CAOSHOSTNAME :: Hostname for the key (localhost)
# - KEYPW :: Password for the key (default ist CaosDBSecret)
# - KEYSTOREPW :: Password for the key store (same as KEYPW)
function
cert
()
{
mkdir
-p
cert
cd
cert
...
...
@@ -41,18 +45,23 @@ function cert() {
KEYPW
=
"
${
KEYPW
}
"
openssl genrsa
-aes256
-out
caosdb.key.pem
\
-passout
env
:KEYPW 2048
# Certificate is for localhost
# Some organization should be given, otherwise Firefox won't even display the certificate.
KEYPW
=
"
${
KEYPW
}
"
openssl req
-new
-x509
-key
caosdb.key.pem
\
-out
caosdb.cert.pem
-passin
env
:KEYPW
\
-subj
"/C=/ST=/L=/O=/OU=/CN=
${
CAOSHOSTNAME
}
"
-days
365
\
-subj
"/C=/ST=/L=/O=example/OU=example/CN=
${
CAOSHOSTNAME
}
"
\
-reqexts
SAN
\
-config
<
(
cat
/etc/ssl/openssl.cnf
\
<
(
printf
"
\n
[SAN]
\n
subjectAltName=DNS:
${
CAOSHOSTNAME
}
"
))
\
KEYPW
=
"
${
KEYPW
}
"
KEYSTOREPW
=
"
$KEYSTOREPW
"
openssl pkcs12
-export
\
-inkey
caosdb.key.pem
-in
caosdb.cert.pem
-out
all-certs.pkcs12
\
-passin
env
:KEYPW
-passout
env
:KEYPW
keytool
-importkeystore
-srckeystore
all-certs.pkcs12
-srcstoretype
PKCS12
\
keytool
-importkeystore
"
$@
"
\
-srckeystore
all-certs.pkcs12
-srcstoretype
PKCS12
\
-deststoretype
pkcs12
-destkeystore
caosdb.jks
\
-srcstorepass
"
${
KEYPW
}
"
\
-destkeypass
"
${
KEYPW
}
"
-deststorepass
"
$KEYSTOREPW
"
echo
"Certificates successfuly created."
}
cert
cert
"
$@
"
This diff is collapsed.
Click to expand it.
tests/test_tickets.py
+
2
−
6
View file @
a821d48e
...
...
@@ -1410,16 +1410,12 @@ def test_ticket_104():
try
:
url
=
db
.
get_config
().
get
(
"
Connection
"
,
"
url
"
)
try
:
from
urllib.parse
import
urlparse
except
BaseException
:
# python2
from
urlparse
import
urlparse
_fullurl
=
urlparse
(
url
)
_netloc
=
_fullurl
.
netloc
_basepath
=
_fullurl
.
path
wrongbasepath
=
_netloc
+
"
/wrongcontextroot/
"
wrongbasepath
=
_fullurl
.
scheme
+
"
://
"
+
_netloc
+
"
/wrongcontextroot/
"
with
pytest
.
raises
(
CaosDBException
):
db
.
configure_connection
(
url
=
wrongbasepath
).
_login
()
finally
:
...
...
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