Skip to content

sregistry-cli with https #251

@tejasdixit836

Description

@tejasdixit836

Hello,

I have trouble using sregistry-cli with sregistry portal, that i have set up with https

I am able to pull/push the images when i am running the sregistry with http but not with https

here is how i have configured https:

DOMAIN_NAME = "https://domainnname"
DOMAIN_NAME_HTTP = "http://domainname"
DOMAIN_NAKED = DOMAIN_NAME_HTTP.replace('http://', '')
(all the ssl certificates in place according to the document and the registry GUI looks fine)

when i am trying to pull/push using sregistry-cli i get this error

ERROR Issue with https://sregistry-domain/api/container/library/alpine:test, try exporting SREGISTRY_REGISTRY_NOHTTPS.

here is my .sregistry file

{
"hub": {
"base": "https://singularity-hub.org/api"
},
"registry": {
"SREGISTRY_REGISTRY_BASE": "https://domainname",
"SREGISTRY_REGISTRY_USERNAME": "user1",
"SREGISTRY_REGISTRY_TOKEN": "fe55533e17c865b33bf583f004fd3token"
},
"SREGISTRY_CLIENT": "registry"
}

if i replace "SREGISTRY_REGISTRY_BASE": "https://domainname" with "http" i get the following error

[client|registry] [database|sqlite:////home/user/.singularity/sregistry.db]
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/urllib3-1.25.7-py3.6.egg/urllib3/contrib/pyopenssl.py", line 485, in wrap_socket
cnx.do_handshake()
File "/usr/local/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1934, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "/usr/local/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1671, in _raise_ssl_error
_raise_current_error()
File "/usr/local/lib/python3.6/site-packages/OpenSSL/_util.py", line 54, in exception_from_error_queue
raise exception_type(errors)
OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/urllib3-1.25.7-py3.6.egg/urllib3/connectionpool.py", line 662, in urlopen
self._prepare_proxy(conn)
File "/usr/local/lib/python3.6/site-packages/urllib3-1.25.7-py3.6.egg/urllib3/connectionpool.py", line 948, in prepare_proxy
conn.connect()
File "/usr/local/lib/python3.6/site-packages/urllib3-1.25.7-py3.6.egg/urllib3/connection.py", line 394, in connect
ssl_context=context,
File "/usr/local/lib/python3.6/site-packages/urllib3-1.25.7-py3.6.egg/urllib3/util/ssl
.py", line 370, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/local/lib/python3.6/site-packages/urllib3-1.25.7-py3.6.egg/urllib3/contrib/pyopenssl.py", line 491, in wrap_socket
raise ssl.SSLError("bad handshake: %r" % e)
ssl.SSLError: ("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/requests-2.22.0-py3.6.egg/requests/adapters.py", line 449, in send
timeout=timeout
File "/usr/local/lib/python3.6/site-packages/urllib3-1.25.7-py3.6.egg/urllib3/connectionpool.py", line 720, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/usr/local/lib/python3.6/site-packages/urllib3-1.25.7-py3.6.egg/urllib3/util/retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='domainname', port=443): Max retries exceeded with url: /containers/2/download/e0f18dea-1bad-441d-ba31-7ce5e851faba (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/sregistry", line 11, in
load_entry_point('sregistry==0.2.32', 'console_scripts', 'sregistry')()
File "/usr/local/lib/python3.6/site-packages/sregistry-0.2.32-py3.6.egg/sregistry/client/init.py", line 323, in main
extra=extra)
File "/usr/local/lib/python3.6/site-packages/sregistry-0.2.32-py3.6.egg/sregistry/client/pull.py", line 37, in main
save=do_save)
File "/usr/local/lib/python3.6/site-packages/sregistry-0.2.32-py3.6.egg/sregistry/main/registry/pull.py", line 116, in pull
show_progress=not self.quiet)
File "/usr/local/lib/python3.6/site-packages/sregistry-0.2.32-py3.6.egg/sregistry/main/base/http.py", line 178, in download
if requests.head(url, verify=verify).status_code in [200, 401]:
File "/usr/local/lib/python3.6/site-packages/requests-2.22.0-py3.6.egg/requests/api.py", line 101, in head
return request('head', url, **kwargs)
File "/usr/local/lib/python3.6/site-packages/requests-2.22.0-py3.6.egg/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.6/site-packages/requests-2.22.0-py3.6.egg/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.6/site-packages/requests-2.22.0-py3.6.egg/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.6/site-packages/requests-2.22.0-py3.6.egg/requests/adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='domainname', port=443): Max retries exceeded with url: /containers/2/download/e0f18dea-1bad-441d-ba31-7ce5e851faba (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))

can you please help

Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions