Skip to content

how can I access https urls? #792

@WeihanLi

Description

@WeihanLi

when I try to access a https url, I got the error as follows:

http https://reservation.weihanli.xyz/api/Reservation --proxy=http://localhost:8888 --debug

Output:

HTTPie 1.0.2
Requests 2.19.1
Pygments 2.2.0
Python 3.7.0 (default, Jun 28 2018, 08:04:48) [MSC v.1912 64 bit (AMD64)]
c:\users\liweihan\anaconda3\python.exe
Windows 10

<Environment {
"colors": 256,
"config": {
"meta": {
"about": "HTTPie configuration file",
"help": "https://httpie.org/doc#config",
"httpie": "1.0.2"
},
"default_options": "[]"
},
"config_dir": "C:\Users\liweihan\AppData\Roaming\\httpie",
"is_windows": true,
"stderr": "<colorama.ansitowin32.StreamWrapper object at 0x000001AB093DBCC0>",
"stderr_isatty": true,
"stdin": "<_io.TextIOWrapper name='' mode='r' encoding='utf-8'>",
"stdin_encoding": "utf-8",
"stdin_isatty": true,
"stdout": "<colorama.ansitowin32.StreamWrapper object at 0x000001AB093DBB70>",
"stdout_encoding": "utf-8",
"stdout_isatty": true
}>

requests.request(**{
"allow_redirects": false,
"auth": "None",
"cert": "None",
"data": {},
"files": {},
"headers": {
"User-Agent": "HTTPie/1.0.2"
},
"method": "get",
"params": {},
"proxies": {
"http": "//localhost:8888"
},
"stream": true,
"timeout": 30,
"url": "https://reservation.weihanli.xyz/api/Reservation",
"verify": true
})

http: error: SSLError: HTTPSConnectionPool(host='reservation.weihanli.xyz', port=443): Max retries exceeded with url: /api/Reservation (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)'))) while doing GET request to URL: https://reservation.weihanli.xyz/api/Reservation
Traceback (most recent call last):
File "c:\users\liweihan\anaconda3\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
chunked=chunked)
File "c:\users\liweihan\anaconda3\lib\site-packages\urllib3\connectionpool.py", line 343, in _make_request
self._validate_conn(conn)
File "c:\users\liweihan\anaconda3\lib\site-packages\urllib3\connectionpool.py", line 849, in validate_conn
conn.connect()
File "c:\users\liweihan\anaconda3\lib\site-packages\urllib3\connection.py", line 356, in connect
ssl_context=context)
File "c:\users\liweihan\anaconda3\lib\site-packages\urllib3\util\ssl
.py", line 359, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "c:\users\liweihan\anaconda3\lib\ssl.py", line 412, in wrap_socket
session=session
File "c:\users\liweihan\anaconda3\lib\ssl.py", line 850, in _create
self.do_handshake()
File "c:\users\liweihan\anaconda3\lib\ssl.py", line 1108, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\users\liweihan\anaconda3\lib\site-packages\requests\adapters.py", line 445, in send
timeout=timeout
File "c:\users\liweihan\anaconda3\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "c:\users\liweihan\anaconda3\lib\site-packages\urllib3\util\retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='reservation.weihanli.xyz', port=443): Max retries exceeded with url: /api/Reservation (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\users\liweihan\anaconda3\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "c:\users\liweihan\anaconda3\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\liweihan\Anaconda3\Scripts\http.exe_main
.py", line 9, in
File "c:\users\liweihan\anaconda3\lib\site-packages\httpie_main
.py", line 11, in main
sys.exit(main())
File "c:\users\liweihan\anaconda3\lib\site-packages\httpie\core.py", line 227, in main
log_error=log_error,
File "c:\users\liweihan\anaconda3\lib\site-packages\httpie\core.py", line 99, in program
final_response = get_response(args, config_dir=env.config.directory)
File "c:\users\liweihan\anaconda3\lib\site-packages\httpie\client.py", line 72, in get_response
response = requests_session.request(**kwargs)
File "c:\users\liweihan\anaconda3\lib\site-packages\requests\sessions.py", line 512, in request
resp = self.send(prep, **send_kwargs)
File "c:\users\liweihan\anaconda3\lib\site-packages\requests\sessions.py", line 622, in send
r = adapter.send(request, **kwargs)
File "c:\users\liweihan\anaconda3\lib\site-packages\requests\adapters.py", line 511, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='reservation.weihanli.xyz', port=443): Max retries exceeded with url: /api/Reservation (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)')))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions