freiheit / discord_feedbot

Moved to https://gitlab.com/ffreiheit/discord_feedbot
MIT License
82 stars 28 forks source link

Asyncio - SSLProto ResourceWarning: unclosed transport #55

Closed nEo-1664 closed 6 years ago

nEo-1664 commented 7 years ago

After recently updating my Ubuntu box, and the feed2discord bot. It runs, but does not seem to post into channel, erroring with the following;

/usr/lib/python3.5/asyncio/sslproto.py:328: ResourceWarning: unclosed transport <asyncio.sslproto._SSLProtocolTransport object at 0x7f10f012a978> warnings.warn("unclosed transport %r" % self, ResourceWarning)

Current version are as follows;

pip freeze aiohttp==2.0.7 args==0.1.0 arrow==0.7.0 async-timeout==1.2.0 asyncio==3.4.3 cffi==1.8.3 chardet==3.0.2 clint==0.5.1 command-not-found==0.3 discord.py==0.16.7 feedparser==5.2.1 html2text==2016.9.19 language-selector==0.1 multidict==2.1.4 pycparser==2.17 pycurl==7.43.0 pygobject==3.20.0 PyNaCl==1.0.1 python-apt==1.1.0b1 python-dateutil==2.6.0 python-debian==0.1.27 python-systemd==231 pytz==2017.2 requests==2.13.0 six==1.10.0 ssh-import-id==5.5 ufw==0.35 unattended-upgrades==0.1 urllib3==1.13.1 websockets==3.3 ws4py==0.4.2 yarl==0.10.0

freiheit commented 7 years ago

That is likely 1 of 2 things:

  1. For some reason you can't reach discordapp.com
  2. Your python doesn't trust the SSL certificate of discordapp.com

On the ubuntu box, try "wget http://discordapp.com", "wget https://discordapp.com" and "openssl s_client -verify 10 -connect discordapp.com:443".

nEo-1664 commented 7 years ago

Seems fine, no errors listed;

wget http://discordapp.com --2017-04-14 15:56:09-- http://discordapp.com/ Resolving discordapp.com (discordapp.com)... 104.16.59.5, 104.16.58.5 Connecting to discordapp.com (discordapp.com)|104.16.59.5|:80... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: https://discordapp.com/ [following] --2017-04-14 15:56:09-- https://discordapp.com/ Connecting to discordapp.com (discordapp.com)|104.16.59.5|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: ‘index.html’

index.html [ <=> ] 24.56K --.-KB/s in 0.009s

2017-04-14 15:56:10 (2.76 MB/s) - ‘index.html’ saved [25147]

nst@nst-discord:~$ wget https://discordapp.com --2017-04-14 15:56:26-- https://discordapp.com/ Resolving discordapp.com (discordapp.com)... 104.16.58.5, 104.16.59.5 Connecting to discordapp.com (discordapp.com)|104.16.58.5|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: ‘index.html.1’

index.html.1 [ <=> ] 24.56K --.-KB/s in 0.009s

2017-04-14 15:56:26 (2.68 MB/s) - ‘index.html.1’ saved [25147]

nst@nst-discord:~$ openssl s_client -verify 10 -connect discordapp.com:443 verify depth is 10 CONNECTED(00000003) depth=3 C = SE, O = AddTrust AB, OU = AddTrust External TTP Network, CN = AddTrust External CA Root verify return:1 depth=2 C = GB, ST = Greater Manchester, L = Salford, O = COMODO CA Limited, CN = COMODO RSA Certification Authority verify return:1 depth=1 C = GB, ST = Greater Manchester, L = Salford, O = COMODO CA Limited, CN = COMODO RSA Domain Validation Secure Server CA verify return:1 depth=0 OU = Domain Control Validated, OU = PositiveSSL, CN = discordapp.com verify return:1

Certificate chain 0 s:/OU=Domain Control Validated/OU=PositiveSSL/CN=discordapp.com i:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Domain Validation Secure Server CA 1 s:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Domain Validation Secure Server CA i:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Certification Authority 2 s:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Certification Authority i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root

Server certificate -----BEGIN CERTIFICATE----- MIIFTzCCBDegAwIBAgIRALOVDwH1AvQ/pCD9Y0gXxYwwDQYJKoZIhvcNAQELBQAw gZAxCzAJBgNVBAYTAkdCMRswGQY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RG9tYWluVmFsaWRhdGlvblNlY3VyZVNlcnZlckNBLmNybDCBhQYIKwYB BQUHAQEEeTB3ME8GCCsGAQUFBzAChkNodHRwOi8vY3J0LmNvbW9kb2NhLmNvbS9D T01PRE9SU0FEb21haW5WYWxpZGF0aW9uU2VjdXJlU2VydmVyQ0EuY3J0MCQGCCsG AQUFBzABhhhodHRwOi8vb2NzcC5jb21vZG9jYS5jb20wLQYDVR0RBCYwJIIOZGlz Y29yZGFwcC5jb22CEnd3dy5kaXNjb3JkYXBwLmNvbTANBgkqhkiG9w0BAQsFAAOC AQEAC8MUE0NSvwnz9pthtitu4l69FUVZ5Gy3s9Bsz4DNDDjPBUm9nBDTvPKNNyqw SqADXGPh1xNnpzHTGStjclrkKmU0uxn+ci7oWduHn5fUzBLT/4j5ivI5/k//ErJF fHwFjYvXWiVoZHrShL3w0ul9cy1vNeq35bv/ATBct/4nz1qMy4n3Wuwr6w9F0EGF 4KBWKrxVpcyzz0I5Kzpq7ChFLu0KR26Nvt71dZ2euZ7E/38vNX2xWMAFnlE+fh+l /YYUnWEggVnyJkqStKETbWsstAdcEb5RqRdoDzlek9Y+PQs/bBJDc3yGDDxKE3Gn W8IJKD+UiW8LGWW2r16MvxLSEg== -----END CERTIFICATE----- subject=/OU=Domain Control Validated/OU=PositiveSSL/CN=discordapp.com issuer=/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Domain Validation Secure Server CA

No client certificate CA names sent Peer signing digest: SHA512 Server Temp Key: ECDH, P-256, 256 bits

SSL handshake has read 4987 bytes and written 431 bytes

New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES128-GCM-SHA256 Server public key is 2048 bit Secure Renegotiation IS supported Compression: NONE Expansion: NONE No ALPN negotiated SSL-Session: Protocol : TLSv1.2 Cipher : ECDHE-RSA-AES128-GCM-SHA256 Session-ID: 5AA1CD53145E04094C347926182A2E3C554DF2A937E9E8F09418BAB276B2B2AD Session-ID-ctx: Master-Key: E99981EE6A5810A8F43CBC3FE7EA2E68F005DF495939E9DB3857DD19107ECFF12B9DF9F995F77CD94BA301C00A0498D0 Key-Arg : None PSK identity: None PSK identity hint: None SRP username: None TLS session ticket lifetime hint: 64800 (seconds) TLS session ticket: 0000 - 45 7b 1d 1a 1f 95 3a 1e-81 2b dc 2f 51 d7 28 a9 E{....:..+./Q.(. 0010 - d9 ee 12 0e 5b 92 2a d6-9a 5e 04 ca 0b 48 92 62 ....[...^...H.b 0020 - f7 3e 82 44 e1 0c d9 76-f4 ff 3f e5 3a 08 d5 be .>.D...v..?.:... 0030 - c1 8d 76 a6 b0 a5 47 2f-33 f8 04 d7 71 19 62 5b ..v...G/3...q.b[ 0040 - 46 10 01 01 eb fd 11 25-87 b9 d1 8e 19 c3 ae a8 F......%........ 0050 - 1c 41 f0 03 14 33 cc fb-4a bf b2 43 17 f5 df 7f .A...3..J..C.... 0060 - eb 5c a0 dd 37 0c 42 67-57 d9 03 33 18 67 d1 ec ...7.BgW..3.g.. 0070 - 9d 05 6c 33 c8 5f 28 d8-99 91 ca 7f 24 b8 2a 74 ..l3._(.....$.t 0080 - 24 f5 48 43 63 d7 e8 d0-26 6d 9b ad cc 35 1b e7 $.HCc...&m...5.. 0090 - 39 92 d6 98 b8 9b d1 4c-7e 8d 9e 16 9f f4 3e 68 9......L~.....>h 00a0 - 7f 3f 89 c9 30 34 07 94-32 ca fe 7f 09 52 a6 f4 .?..04..2....R..

Start Time: 1492181811
Timeout   : 300 (sec)
Verify return code: 0 (ok)

closed