Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
kedifa
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Aurel
kedifa
Commits
61dd2329
Commit
61dd2329
authored
Nov 04, 2020
by
Aurel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apply master change & remove useless six
parent
98c549e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
11 deletions
+3
-11
kedifa/test.py
kedifa/test.py
+3
-11
No files found.
kedifa/test.py
View file @
61dd2329
...
...
@@ -98,7 +98,7 @@ class KedifaMixinCaucase(KedifaMixin):
x509
.
NameAttribute
(
NameOID
.
ORGANIZATION_NAME
,
u"KeDiFa Test"
),
])).
add_extension
(
x509
.
SubjectAlternativeName
([
x509
.
IPAddress
(
ipaddress
.
ip_address
(
six
.
text_type
(
ip
)
))
x509
.
IPAddress
(
ipaddress
.
ip_address
(
ip
))
]),
critical
=
False
,
).
sign
(
key
,
hashes
.
SHA256
(),
default_backend
())
...
...
@@ -112,14 +112,6 @@ class KedifaMixinCaucase(KedifaMixin):
self
,
not_valid_before
=
datetime
.
datetime
.
utcnow
()
-
datetime
.
timedelta
(
days
=
1
),
not_valid_after
=
datetime
.
datetime
.
utcnow
()
+
datetime
.
timedelta
(
days
=
2
)):
"""Generates certificate and key
Returns a tuple with:
- key as a classcryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKey
- pem encoded key as string
- certificate as a cryptography.x509.Certificate
- pem encoded certificate as string
"""
key
,
key_pem
=
self
.
createKey
()
subject
=
issuer
=
x509
.
Name
([
x509
.
NameAttribute
(
NameOID
.
COUNTRY_NAME
,
u"XX"
),
...
...
@@ -171,9 +163,9 @@ class KedifaMixinCaucase(KedifaMixin):
self
.
caucase_runtime
.
start
()
self
.
assertTrue
(
self
.
caucase_runtime
.
is_alive
())
self
.
caucase_url
=
'http://[%s]:%s'
%
(
ip
,
port
)
# give
10
s for caucase to be available
# give
5
s for caucase to be available
b
=
time
.
time
()
for
i
in
range
(
10
0
):
for
i
in
range
(
5
0
):
try
:
requests
.
get
(
self
.
caucase_url
)
except
BaseException
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment