前提・実現したいこと
DiscordのBOTを作成し、動作させたい。
terminalで「Python3 Disco.py」と実行したところ、以下のエラーが出ました。
ものすごく多いです。
発生している問題・エラーメッセージ
terminal
1SSL handshake failed on verifying the certificate 2protocol: <asyncio.sslproto.SSLProtocol object at 0x109834080> 3transport: <_SelectorSocketTransport fd=10 read=polling write=<idle, bufsize=0>> 4Traceback (most recent call last): 5 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 625, in _on_handshake_complete 6 raise handshake_exc 7 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 189, in feed_ssldata 8 self._sslobj.do_handshake() 9 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 763, in do_handshake 10 self._sslobj.do_handshake() 11ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056) 12SSL error in data received 13protocol: <asyncio.sslproto.SSLProtocol object at 0x109834080> 14transport: <_SelectorSocketTransport closing fd=10 read=idle write=<idle, bufsize=0>> 15Traceback (most recent call last): 16 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 526, in data_received 17 ssldata, appdata = self._sslpipe.feed_ssldata(data) 18 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 189, in feed_ssldata 19 self._sslobj.do_handshake() 20 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 763, in do_handshake 21 self._sslobj.do_handshake() 22ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056) 23SSL handshake failed on verifying the certificate 24protocol: <asyncio.sslproto.SSLProtocol object at 0x10983e908> 25transport: <_SelectorSocketTransport fd=10 read=polling write=<idle, bufsize=0>> 26Traceback (most recent call last): 27 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 625, in _on_handshake_complete 28 raise handshake_exc 29 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 189, in feed_ssldata 30 self._sslobj.do_handshake() 31 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 763, in do_handshake 32 self._sslobj.do_handshake() 33ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056) 34SSL error in data received 35protocol: <asyncio.sslproto.SSLProtocol object at 0x10983e908> 36transport: <_SelectorSocketTransport closing fd=10 read=idle write=<idle, bufsize=0>> 37Traceback (most recent call last): 38 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 526, in data_received 39 ssldata, appdata = self._sslpipe.feed_ssldata(data) 40 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 189, in feed_ssldata 41 self._sslobj.do_handshake() 42 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 763, in do_handshake 43 self._sslobj.do_handshake() 44ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056) 45SSL handshake failed on verifying the certificate 46protocol: <asyncio.sslproto.SSLProtocol object at 0x10984aba8> 47transport: <_SelectorSocketTransport fd=10 read=polling write=<idle, bufsize=0>> 48Traceback (most recent call last): 49 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 625, in _on_handshake_complete 50 raise handshake_exc 51 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 189, in feed_ssldata 52 self._sslobj.do_handshake() 53 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 763, in do_handshake 54 self._sslobj.do_handshake() 55ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056) 56SSL error in data received 57protocol: <asyncio.sslproto.SSLProtocol object at 0x10984aba8> 58transport: <_SelectorSocketTransport closing fd=10 read=idle write=<idle, bufsize=0>> 59Traceback (most recent call last): 60 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 526, in data_received 61 ssldata, appdata = self._sslpipe.feed_ssldata(data) 62 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 189, in feed_ssldata 63 self._sslobj.do_handshake() 64 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 763, in do_handshake 65 self._sslobj.do_handshake() 66ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056) 67SSL handshake failed on verifying the certificate 68protocol: <asyncio.sslproto.SSLProtocol object at 0x10984acf8> 69transport: <_SelectorSocketTransport fd=10 read=polling write=<idle, bufsize=0>> 70Traceback (most recent call last): 71 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 625, in _on_handshake_complete 72 raise handshake_exc 73 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 189, in feed_ssldata 74 self._sslobj.do_handshake() 75 76あまりにも長すぎて投稿できないので省略 77 78 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 763, in do_handshake 79 self._sslobj.do_handshake() 80ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056) 81SSL error in data received 82protocol: <asyncio.sslproto.SSLProtocol object at 0x10984acf8> 83transport: <_SelectorSocketTransport closing fd=10 read=idle write=<idle, bufsize=0>> 84Traceback (most recent call last): 85 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 526, in data_received 86 ssldata, appdata = self._sslpipe.feed_ssldata(data) 87 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 189, in feed_ssldata 88 self._sslobj.do_handshake() 89 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 763, in do_handshake 90 self._sslobj.do_handshake() 91ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056) 92SSL handshake failed on verifying the certificate 93protocol: <asyncio.sslproto.SSLProtocol object at 0x10984ae48> 94transport: <_SelectorSocketTransport fd=10 read=polling write=<idle, bufsize=0>> 95Traceback (most recent call last): 96 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 625, in _on_handshake_complete 97 raise handshake_exc 98 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 189, in feed_ssldata 99 self._sslobj.do_handshake() 100 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 763, in do_handshake 101 self._sslobj.do_handshake() 102ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056) 103SSL error in data received 104protocol: <asyncio.sslproto.SSLProtocol object at 0x10984ae48> 105transport: <_SelectorSocketTransport closing fd=10 read=idle write=<idle, bufsize=0>> 106Traceback (most recent call last): 107 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 526, in data_received 108 ssldata, appdata = self._sslpipe.feed_ssldata(data) 109 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 189, in feed_ssldata 110 self._sslobj.do_handshake() 111 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 763, in do_handshake 112 113 114 115 116あまりにも長すぎて投稿できないので省略 117 118 119 120aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host discordapp.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)')] 121
該当のソースコード
Python
1import discord 2 3client = discord.Client() 4token = "????????????????????????????????????????????????A" 5#tokenは隠しておきます。 6@client.event 7async def on_ready(): 8 print('Logged in as') 9 print(client.user.name) 10 print(client.user.id) 11 print('------') 12 13@client.event 14async def on_message(message): 15 # 「おはよう」で始まるか調べる 16 if message.content.startswith("おはよう"): 17 # 送り主がBotだった場合反応したくないので 18 if client.user != message.author: 19 # メッセージを書きます 20 m = "おはようございます" + message.author.name + "!" 21 # メッセージが送られてきたチャンネルへメッセージを送ります 22 await message.channel.send(m) 23 24client.run(token)
試したこと
discord.pyを再インストールしましたが、変わりませんでした。
補足情報
macOS Catalina Ver 10.15.4
Python3.7
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/06/06 15:18