Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Andrew Leonard
kisfido
Commits
c96a6b3c
Commit
c96a6b3c
authored
Jun 22, 2022
by
Andrew Leonard
Browse files
Have fetch load ssl and user certs and set downloader client session
parent
0c44a495
Changes
1
Hide whitespace changes
Inline
Side-by-side
sdc/client.py
View file @
c96a6b3c
...
...
@@ -26,6 +26,8 @@ from urllib.error import HTTPError, URLError
import
json
import
parfive
from
rucio.client
import
Client
import
aiohttp
import
ssl
walker
=
AttrWalker
()
...
...
@@ -338,6 +340,8 @@ class KISClient(BaseClient):
if
not
len
(
query_results
):
return
downloader
.
config
.
config
.
aiohttp_session_generator
=
self
.
_load_ssl_certs
for
row
in
query_results
:
scope
,
name
=
row
[
'links'
].
split
(
':'
)
...
...
@@ -351,6 +355,14 @@ class KISClient(BaseClient):
**
row
.
response_block_map
),
headers
=
self
.
rucio
.
headers
)
def
_load_ssl_certs
(
self
,
config
):
creds
=
self
.
rucio
.
creds
ssl_ctx
=
ssl
.
create_default_context
(
cafile
=
self
.
rucio
.
ca_cert
)
ssl_ctx
.
load_cert_chain
(
creds
[
'client_cert'
],
creds
[
'client_key'
])
conn
=
aiohttp
.
TCPConnector
(
ssl
=
ssl_ctx
)
return
aiohttp
.
ClientSession
(
connector
=
conn
,
headers
=
config
.
headers
)
@
classmethod
def
_can_handle_query
(
cls
,
*
query
,
hasinstr
=
False
):
"""
...
...
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