Nandaka / DanbooruDownloader

*booru image downloader
http://nandaka.devnull.zone/
392 stars 38 forks source link

Could not create SSL/TLS secure channel #189

Open matsumotokenji opened 5 years ago

matsumotokenji commented 5 years ago

When i try to download from Sankaku Complex(HTTPS) provider today got the Could not create SSL/TLS secure channel error. but i still able to access the direct image link produced by DanbooruDownloader below: https://cs.sankakucomplex.com/data/28/07/2807fa7da4b57bf7b547aae6a95bdea8.jpg?e=1566728496&m=ajgKaORROyKskZaL1KAD4w

with the same tag it works fine at danbooru provider.

below the logs

2019-08-24 19:09:59,864 INFO - Logging Enabled 2019-08-24 19:10:00,023 INFO - Starting up Danbooru Downloader 3.2018.29.10 2019-08-24 19:10:00,029 DEBUG - Loading provider list. 2019-08-24 19:10:00,048 DEBUG - Provider list loaded. 2019-08-24 19:10:00,058 DEBUG - Danbooru Downloader 3.2018.29.10 loaded. 2019-08-24 19:10:33,357 INFO - Logging Enabled 2019-08-24 19:10:33,515 INFO - Starting up Danbooru Downloader 3.2018.29.10 2019-08-24 19:10:33,522 DEBUG - Loading provider list. 2019-08-24 19:10:33,539 DEBUG - Provider list loaded. 2019-08-24 19:10:33,549 DEBUG - Danbooru Downloader 3.2018.29.10 loaded. 2019-08-24 19:10:43,622 INFO - [DoBatchJob] Processing Batch Job#0 2019-08-24 19:10:43,642 INFO - [DoBatchJob] Downloading list: https://chan.sankakucomplex.com/?tags=atago_(azur_lane)&page=1&login=abcd&password_hash=**** 2019-08-24 19:10:46,408 INFO - [DoBatchJob] Getting file_url from https://chan.sankakucomplex.com/post/show/16554250 2019-08-24 19:10:47,108 INFO - [DoBatchJob] Download: https://cs.sankakucomplex.com/data/28/07/2807fa7da4b57bf7b547aae6a95bdea8.jpg?e=1566728496&m=ajgKaORROyKskZaL1KAD4w 2019-08-24 19:10:47,551 ERROR - [DoBatchJob] Error Download Batch Image (0 of 5): The request was aborted: Could not create SSL/TLS secure channel. Wait for 60s. System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel. at System.Net.WebClient.DownloadFile(Uri address, String fileName) at DanbooruDownloader3.FormMain.DoDownloadBatch(String targetUrl, DanbooruBatchJob job, DanbooruPost post, String filename) 2019-08-24 19:11:47,562 INFO - [DoBatchJob] Retrying... 2019-08-24 19:11:47,991 ERROR - [DoBatchJob] Error Download Batch Image (1 of 5): The request was aborted: Could not create SSL/TLS secure channel. Wait for 60s. System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel. at System.Net.WebClient.DownloadFile(Uri address, String fileName) at DanbooruDownloader3.FormMain.DoDownloadBatch(String targetUrl, DanbooruBatchJob job, DanbooruPost post, String filename)

Nandaka commented 5 years ago

Weird, it is loaded in my pc. Do you have any antivirus/firewall/internet security/proxy? or try on different pc?

![image](https://user-images.githubusercontent.com/836867/63644270-c8e2e900-c717-11e9-853e-665443b5747b.png)
2019-08-25 09:07:10,476 INFO  - [DoBatchJob] Processing Batch Job#0
2019-08-25 09:07:10,527 INFO  - [DoBatchJob] Downloading list: https://chan.sankakucomplex.com/?tags=atago_(azur_lane)&page=1
2019-08-25 09:07:13,436 INFO  - [DoBatchJob] Getting file_url from https://chan.sankakucomplex.com/post/show/16623520
2019-08-25 09:07:14,307 INFO  - [DoBatchJob] Download: https://cs.sankakucomplex.com/data/ac/a8/aca8c1b4ac8cd07465717f0878fff4a3.jpg?e=1566781633&m=VkT-AqQylpR96BOOI_J7jg
2019-08-25 09:07:15,663 INFO  - [DoBatchJob] Saved To: D:\Temp\atago_(azur_lane)\Sankaku Complex (HTTPS)\q - 16623520 -  atago (azur lane) - 1girl animal ears atago (azur lane) azur lane bangs black hair b.jpg
Romangelo commented 5 years ago

Same issue here.

[DoBatchJob] Getting file_url from https://chan.sankakucomplex.com/post/show/16618610 [DoBatchJob] Download: https://cs.sankakucomplex.com/data/cc/bb/ccbb98043dbaf64c2916455f9ef4c4d1.png?e=1566853013&m=WAwCGul68Zq97x7StWWCWw [DoBatchJob] Error Download Batch Image (0 of 3): The request was aborted: Could not create SSL/TLS secure channel. Wait for 180s.

Romangelo commented 5 years ago

I tried on another PC and it works fine. This one has Windows 10, while the one with the issue has Win 7.

matsumotokenji commented 5 years ago

My OS also win7, problem occurs after latest Windows update.

Nandaka commented 5 years ago

DanbooruDownloader3.zip

Try to replace the exe file? I'm enabling older cypher and let see it is working. image

matsumotokenji commented 5 years ago

Same issue

2019-08-26 23:07:16,071 ERROR - [DoBatchJob] Error Download Batch Image (0 of 5): The request was aborted: Could not create SSL/TLS secure channel. Wait for 60s. System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel. at System.Net.WebClient.DownloadFile(Uri address, String fileName) at DanbooruDownloader3.FormMain.DoDownloadBatch(String targetUrl, DanbooruBatchJob job, DanbooruPost post, String filename)

Romangelo commented 5 years ago

DanbooruDownloader3.zip

Try to replace the exe file? I'm enabling older cypher and let see it is working. image

Replaced it, still having the same error.

Nandaka commented 5 years ago

can you check what is the security protocol being used? image

Romangelo commented 5 years ago

Connection - secure connection settings The connection to this site is encrypted and authenticated using TLS 1.2, ECDHE_RSA with P-256, and AES_128_GCM.

Nandaka commented 5 years ago

Weird, the original exe already uses Tls12. Something must be wrong on the Win7 update...

https://github.com/Nandaka/DanbooruDownloader/blob/master/DanbooruDownloader3/CustomControl/ExtendedWebClient.cs#L19

Nandaka commented 5 years ago

not sure if this help? Try to modify the app.config and add this line: <AppContextSwitchOverrides value="Switch.System.Net.DontEnableSchUseStrongCrypto=true"/>

https://support.microsoft.com/en-us/help/3069494/cannot-connect-to-a-server-by-using-the-servicepointmanager-or-sslstre#workaround

Romangelo commented 5 years ago

You mean the DanbooruDownloader3.exe.config file?

Tried that, still getting the same error.

My Win7 is a pirated OS though. I've never updated it.

Nandaka commented 5 years ago

hmm, no idea then. I don't have win7 anymore and it is working on win10 without error. Can you open the site using IE (because .Net share same code with it, I think), else, try to update the .Net 4.6.x?

Romangelo commented 5 years ago

hmm, no idea then. I don't have win7 anymore and it is working on win10 without error. Can you open the site using IE (because .Net share same code with it, I think), else, try to update the .Net 4.6.x?

IE probably is the culprit. I tried going on the site with IE and no image displaying. When I click to view the original image file, IE displays this error:

Turn on SSL 3.0, TLS 1.0, TLS 1.1 and TLS 1.2 in Advanced settings and try connecting to https://cs.sankakucomplex.com again.

I did turn those options on in the IE settings, but the site still doesn't show any image.

matsumotokenji commented 5 years ago

Same issue here 2019-08-29 01_35_42-This page can’t be displayed - Internet Explorer

I can access https://cs.sankakucomplex.com with Chrome but not IE I believe is like sankakucomplex is doing something. Maybe is the browser agent? like sankakucomplex imafe server suddently blocking IE on windows 7 note: Changing user agent don't help

matsumotokenji commented 5 years ago

Also updated .net framework to latest. Not working either.

Nandaka commented 5 years ago

because .Net share the same code for the encryption which handled by the os, most likely sankaku uses newer crypt that is not supported by win7. Chrome have no issues as it uses its own engine.

EDIT: try to disable TLS1.2 on ie and try again in the browser?

Romangelo commented 5 years ago

So.... there's no way to fix this? I can use it on my Win10 laptop, but my main PC is on 7 and I don't wanna upgrade though.

Nandaka commented 5 years ago

edit the DanbooruProviderList.xml and disable https for sankaku?

Romangelo commented 5 years ago

edit the DanbooruProviderList.xml and disable https for sankaku?

It works!

IE can't connect to sankaku without https (always redirects to the https) but the downloader can download from http site.

Thanks.

Nandaka commented 5 years ago

Hmm, my win10 .Net is using 4.8 btw image https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed#net_b

also, not sure if it is related: https://stackoverflow.com/a/44765698

matsumotokenji commented 5 years ago

edit the DanbooruProviderList.xml and disable https for sankaku?

It works!

IE can't connect to sankaku without https (always redirects to the https) but the downloader can download from http site.

Thanks.

err... May i know how do you do that? what i can think of is change https://chan.sankakucomplex.com into http://chan.sankakucomplex.com but it did't work.

ok it worked! for my case i also have to edit my saved lists.

Thanks!