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
67fdc908
Commit
67fdc908
authored
Nov 04, 2020
by
Aurel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove useless code
parent
7ccb530a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
32 deletions
+1
-32
kedifa/test.py
kedifa/test.py
+1
-32
No files found.
kedifa/test.py
View file @
67fdc908
...
...
@@ -77,9 +77,6 @@ class KedifaMixin(object):
class
KedifaMixinCaucase
(
KedifaMixin
):
def
createKey
(
self
):
"""Generates a key and return a tuple containing the RSAPrivateKey
and the PEM encoded version as a string.
"""
key
=
rsa
.
generate_private_key
(
public_exponent
=
65537
,
key_size
=
2048
,
backend
=
default_backend
())
key_pem
=
key
.
private_bytes
(
...
...
@@ -137,7 +134,7 @@ class KedifaMixinCaucase(KedifaMixin):
not_valid_after
).
sign
(
key
,
hashes
.
SHA256
(),
default_backend
())
certificate_pem
=
certificate
.
public_bytes
(
serialization
.
Encoding
.
PEM
)
return
key
,
key_pem
,
certificate
,
certificate_pem
#.decode('ascii')
return
key
,
key_pem
,
certificate
,
certificate_pem
def
createPem
(
self
):
_
,
key_pem
,
_
,
certificate_pem
=
self
.
generateKeyCertificateData
()
...
...
@@ -322,34 +319,6 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
with
open
(
self
.
logfile
)
as
fh
:
last_log_line
=
fh
.
readlines
()[
-
1
]
if
sys
.
version_info
[:
2
]
==
(
3
,
5
):
# BBB python 3.5 compatibility
# On python3.5, errors like this are logged on SSL client errors:
#
# $timestamp - kedifa - ERROR - Exception while handling the request
# Traceback (most recent call last):
# File "/usr/lib/python3.5/wsgiref/handlers.py", line 138, in run
# self.finish_response()
# File "/usr/lib/python3.5/wsgiref/handlers.py", line 180, in finish_response
# self.write(data)
# File "/usr/lib/python3.5/wsgiref/handlers.py", line 279, in write
# self._write(data)
# File "/usr/lib/python3.5/wsgiref/handlers.py", line 453, in _write
# result = self.stdout.write(data)
# File "/usr/lib/python3.5/socket.py", line 594, in write
# return self._sock.send(b)
# File "/usr/lib/python3.5/ssl.py", line 869, in send
# return self._sslobj.write(data)
# File "/usr/lib/python3.5/ssl.py", line 594, in write
# return self._sslobj.write(data)
# ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:1949)
with
open
(
self
.
logfile
)
as
fh
:
line_list
=
fh
.
readlines
()
before_last_log_line
=
line_list
[
-
2
]
if
len
(
line_list
)
>
2
else
''
if
"ssl.SSLEOFError: EOF occurred in violation of protocol"
in
before_last_log_line
:
# and the actual "last" log line is before this traceback.
# BBB drop: all this when we stop supporting 3.5
last_log_line
=
line_list
[
-
19
]
self
.
assertTrue
(
entry
in
last_log_line
,
'%r not found in %r'
%
(
entry
,
last_log_line
))
...
...
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