问题描述 (Description)
调用退款功能的时候报错
配置信息 (Environment/Version)
-
OS
Mac
-
Python
3.6
-
wechatpy
1.8.13
报错信息
Error handling request
Traceback (most recent call last):
File "/Users/wuyazi/.local/share/virtualenvs/mississippi-uec03K_7/lib/python3.6/site-packages/urllib3/connectionpool.py", line 677, in urlopen
chunked=chunked,
File "/Users/wuyazi/.local/share/virtualenvs/mississippi-uec03K_7/lib/python3.6/site-packages/urllib3/connectionpool.py", line 381, in _make_request
self._validate_conn(conn)
File "/Users/wuyazi/.local/share/virtualenvs/mississippi-uec03K_7/lib/python3.6/site-packages/urllib3/connectionpool.py", line 976, in validate_conn
conn.connect()
File "/Users/wuyazi/.local/share/virtualenvs/mississippi-uec03K_7/lib/python3.6/site-packages/urllib3/connection.py", line 370, in connect
ssl_context=context,
File "/Users/wuyazi/.local/share/virtualenvs/mississippi-uec03K_7/lib/python3.6/site-packages/urllib3/util/ssl.py", line 365, in ssl_wrap_socket
context.load_cert_chain(certfile, keyfile)
ssl.SSLError: [SSL] PEM lib (_ssl.c:3401)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/wuyazi/.local/share/virtualenvs/mississippi-uec03K_7/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/Users/wuyazi/.local/share/virtualenvs/mississippi-uec03K_7/lib/python3.6/site-packages/urllib3/connectionpool.py", line 725, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/Users/wuyazi/.local/share/virtualenvs/mississippi-uec03K_7/lib/python3.6/site-packages/urllib3/util/retry.py", line 439, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.mch.weixin.qq.com', port=443): Max retries exceeded with url: /secapi/pay/refund (Caused by SSLError(SSLError(336445449, '[SSL] PEM lib (_ssl.c:3401)'),))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/wuyazi/.local/share/virtualenvs/mississippi-uec03K_7/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 381, in start
resp = await self._request_handler(request)
File "/Users/wuyazi/.local/share/virtualenvs/mississippi-uec03K_7/lib/python3.6/site-packages/aiohttp/web_app.py", line 310, in _handle
resp = await handler(request)
File "/Users/wuyazi/.local/share/virtualenvs/mississippi-uec03K_7/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 88, in impl
return await handler(request)
File "/Users/wuyazi/italki/mississippi/src/middlewares/error.py", line 11, in middleware_handler
response = await handler(request)
File "/Users/wuyazi/.local/share/virtualenvs/mississippi-uec03K_7/lib/python3.6/site-packages/aiohttp/web_urldispatcher.py", line 741, in _iter
resp = await method()
File "/Users/wuyazi/italki/mississippi/src/common/validate.py", line 31, in wrapper
return await func(self, *args, **kwargs)
File "/Users/wuyazi/italki/mississippi/src/apis/refund.py", line 35, in post
fee_type=params.get('fee_type', 'CNY'))
File "/Users/wuyazi/.local/share/virtualenvs/mississippi-uec03K_7/lib/python3.6/site-packages/wechatpy/pay/api/refund.py", line 43, in apply
return self._post('secapi/pay/refund', data=data)
File "/Users/wuyazi/.local/share/virtualenvs/mississippi-uec03K_7/lib/python3.6/site-packages/wechatpy/pay/base.py", line 18, in _post
return self._client.post(url, **kwargs)
File "/Users/wuyazi/.local/share/virtualenvs/mississippi-uec03K_7/lib/python3.6/site-packages/wechatpy/pay/init.py", line 193, in post
**kwargs
File "/Users/wuyazi/.local/share/virtualenvs/mississippi-uec03K_7/lib/python3.6/site-packages/wechatpy/pay/init.py", line 138, in _request
**kwargs
File "/Users/wuyazi/.local/share/virtualenvs/mississippi-uec03K_7/lib/python3.6/site-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/Users/wuyazi/.local/share/virtualenvs/mississippi-uec03K_7/lib/python3.6/site-packages/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "/Users/wuyazi/.local/share/virtualenvs/mississippi-uec03K_7/lib/python3.6/site-packages/requests/adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.mch.weixin.qq.com', port=443): Max retries exceeded with url: /secapi/pay/refund (Caused by SSLError(SSLError(336445449, '[SSL] PEM lib (_ssl.c:3401)'),))
question T: 微信支付