Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
17
Merge Requests
17
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
5f4e470a
Commit
5f4e470a
authored
Jun 24, 2022
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slap,cli/register: verify server certificate
parent
2b481142
Pipeline
#22330
passed with stage
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
+3
-7
slapos/cli/register.py
slapos/cli/register.py
+3
-4
slapos/slap/hateoas.py
slapos/slap/hateoas.py
+0
-3
No files found.
slapos/cli/register.py
View file @
5f4e470a
...
...
@@ -140,7 +140,7 @@ class RegisterCommand(Command):
def
check_credentials
(
url
,
login
,
password
):
"""Check if login and password are correct"""
req
=
requests
.
get
(
url
,
auth
=
(
login
,
password
)
,
verify
=
False
)
req
=
requests
.
get
(
url
,
auth
=
(
login
,
password
))
return
'Logout'
in
req
.
text
...
...
@@ -150,11 +150,10 @@ def get_certificate_key_pair(logger, master_url_web, node_name, token=None, logi
if
token
:
req
=
requests
.
post
(
'/'
.
join
([
master_url_web
,
'Person_requestComputer'
]),
data
=
{
'title'
:
node_name
},
headers
=
{
'X-Access-Token'
:
token
},
verify
=
False
)
headers
=
{
'X-Access-Token'
:
token
})
else
:
register_server_url
=
'/'
.
join
([
master_url_web
,
(
"Person_requestComputer?title={}"
.
format
(
node_name
))])
req
=
requests
.
get
(
register_server_url
,
auth
=
(
login
,
password
)
,
verify
=
False
)
req
=
requests
.
get
(
register_server_url
,
auth
=
(
login
,
password
))
if
not
req
.
ok
and
'Certificate still active.'
in
req
.
text
:
# raise a readable exception if the computer name is already used,
...
...
slapos/slap/hateoas.py
View file @
5f4e470a
...
...
@@ -101,8 +101,6 @@ class ConnectionHelper:
else
:
cert
=
None
# XXX TODO: handle host cert verify
# Old behavior was to pass empty parameters as "None" value.
# Behavior kept for compatibility with old slapproxies (< v1.3.3).
# Can be removed when old slapproxies are no longer in use.
...
...
@@ -114,7 +112,6 @@ class ConnectionHelper:
req
=
method
(
url
=
url
,
params
=
params
,
cert
=
cert
,
verify
=
False
,
data
=
data
,
headers
=
headers
,
timeout
=
self
.
timeout
)
...
...
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