navossoc / KeePass-Yet-Another-Favicon-Downloader

Yet Another Favicon Downloader for KeePass 2.x
MIT License
532 stars 30 forks source link

Fail to find favicon for arran.com #17

Closed me-and closed 5 years ago

me-and commented 6 years ago

Hi,

YAFD is failing to find the favicon for https://www.arran.com. I believe it should be finding an icon based on the following lines in the <head> block of the site homepage:

<link  rel="icon" type="image/x-icon" href="https://www.arran.com/pub/media/favicon/stores/1/Arran.gif" />
<link  rel="shortcut icon" type="image/x-icon" href="https://www.arran.com/pub/media/favicon/stores/1/Arran.gif" />
navossoc commented 6 years ago

You are right, most of this issues are connection related (SSL/TLS handshakes or webserver settings).

arran:
 System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
   at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
   at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.ConnectStream.WriteHeaders(Boolean async)
   --- End of inner exception stack trace ---
   at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
   at System.Net.WebClient.DownloadString(Uri address)
   at YetAnotherFaviconDownloader.FaviconDownloader.DownloadPage(Uri address) in D:\Projects\KeePass-YAFD\YAFD\FaviconDownloader.cs:line 184
   at YetAnotherFaviconDownloader.FaviconDownloader.GetIcon(String url) in D:\Projects\KeePass-YAFD\YAFD\FaviconDownloader.cs:line 65

The .NET framework has some obscure behavior when we talk about HTTPS and security, besides, some of this security settings are managed by KeePass itself.

I'm doing a completely rewrite of this plugin to fix this kind of issues, including more tests on linux, since Mono has a lot of quirks to be addressed.

navossoc commented 5 years ago

I'm not sure if the site has changed or if commit 65fd9f0aab95bb2b7c41599d5ab0b75dd2e03e1f fixed it. Anyway, solved ;)