DiscordMessenger / dm

Discord Messenger is a free Discord-compatible messaging client targeting both new and old Windows.
MIT License
862 stars 16 forks source link

Issue with showing certain images #37

Closed Zero3K closed 4 months ago

Zero3K commented 4 months ago

image

Zero3K commented 4 months ago

Is there any way I can help debug this issue?

Zero3K commented 4 months ago

It is also happening under Windows 7.

Zero3K commented 4 months ago

I wonder if -1 is a CORS issue or if it should just be interpreted as SUCCESS.

iProgramMC commented 4 months ago

It says "SSL connection failed" so definitely no success here.

Zero3K commented 4 months ago

You're right.

Zero3K commented 4 months ago

Maybe the image is being requested improperly.

iProgramMC commented 4 months ago

That url looks fine to me.

Zero3K commented 4 months ago

I mean, the program is trying to request it in an unexpected way.

Zero3K commented 4 months ago

Would Fiddler Classic help debug the issue?

Zero3K commented 4 months ago

I tried using it but it doesn't show the requests done by Discord Messenger since it isn't using Fiddler Classic's proxy function. Adding the ability for it to connect to Discord via a proxy server would let me use Fiddler Classic to debug this issue.

iProgramMC commented 4 months ago

You can do that.

Zero3K commented 4 months ago

How? I am not a programmer.

iProgramMC commented 4 months ago

You haven't looked hard enough. It's in the preferences menu, Connection tab. You can set the Discord API URL to your Fiddler instance.

Zero3K commented 4 months ago

Its a proxy, not a Discord Server.

iProgramMC commented 4 months ago

You can fire HTTP requests to your Fiddler instance, correct? Therefore its IP address works in the API URL field.

Zero3K commented 4 months ago

It's not providing Discord API. It's a web proxy. How do I get it to use that proxy to connect to Discord's API web address?

iProgramMC commented 4 months ago

You set up your proxy to forward HTTP requests it receives to Discord's API. D'oh!

iProgramMC commented 4 months ago

Well, and then you make DM connect to your proxy.

Zero3K commented 4 months ago

It doesn't work.

iProgramMC commented 4 months ago

Alright.

iProgramMC commented 4 months ago

I suggest you don't publish raw traffic dumps as they contain your discord token. You'll want to revoke your token by logging out from the instance of Discord you logged in with and stole the token from.

Zero3K commented 4 months ago

Then how can I help fix the issue?

EDIT: I think it might be a WCF issue (I have a router that has Web Content filtering, which allows me to block ads, etc.).

Zero3K commented 4 months ago

Yeah, it is an issue with using WCF via the Default Rule page in the Firewall's General Setup. What's weird is that I can access the URL just fine with a web browser.

Zero3K commented 4 months ago

So, I think the only way to get it fixed is for you to add system proxy support or logging of HTTPS requests to a file to DM so I can use Fiddler Classic to look at the request that is giving an error or give you the log so you can look for the cause and fix it.

iProgramMC commented 4 months ago

I think it might be a WCF issue (I have a router that has Web Content filtering, which allows me to block ads, etc.).

You might want to whitelist cdn.discordapp.com then.

Zero3K commented 4 months ago

I think it might be a WCF issue (I have a router that has Web Content filtering, which allows me to block ads, etc.).

You might want to whitelist cdn.discordapp.com then.

I am able to view the image associated with the URL in a browser though.

Zero3K commented 4 months ago

This is weird, its not happening even though I re-enabled the WCF rule in my router.

Zero3K commented 4 months ago

And now it is happening again.

iProgramMC commented 4 months ago

Could be. Did you check the task manager's GDI object column? You can select columns shown in the "details" tab of task manager by right clicking the column header and selecting "Select columns". image

(that 193 is the number of GDI objects allocated by the app) image

Zero3K commented 4 months ago

You replied to the wrong issue.

Zero3K commented 4 months ago

I wonder if it is getting a 302 code instead of a 200 code.

iProgramMC commented 4 months ago

It's... not getting anything because it can't connect in the first place. "-1" means there was no reply from the server.

Zero3K commented 4 months ago

I thought it meant a timeout or something.

Zero3K commented 4 months ago

Please add the ability for it to produce a request log so I can help debug this issue.

iProgramMC commented 4 months ago

I'm totally unsure how I can debug it, much less you. I really don't know, you probably have spotty internet or something. I'm going to close the issue because it doesn't seem like we can figure it out anytime soon.

Zero3K commented 4 months ago

I know how to debug it. I just need it to support system proxy settings so I can use Fiddler Classic to see what it shows when the error occurs.

Zero3K commented 4 months ago

image

iProgramMC commented 4 months ago

Here's a breakdown, as I was able to understand:

error:C102C723:system library::reason(1090701091)   -> 0x4102C723
error:4102C723:lib(130)::reason(182051)             -> 0x0002C723
error:0002C723:lib(0)::reason(182051)               -> 0x0002C723 (LOOP)

It might be throwing error number 130 in a system library, which on Windows is supposedly EOPNOTSUPP. Something isn't supported somehow.

Zero3K commented 4 months ago

I guess adding more debug output to the error dialog box is needed to find the thing that is not being supported.

Zero3K commented 4 months ago

image image

Zero3K commented 4 months ago

image

Zero3K commented 4 months ago

I wonder if it is possible to switch to a different SSL library (such as mbedTLS) since OpenSSL is giving a bunch of error codes.

iProgramMC commented 4 months ago

It is possible. Someone has done it before. You will need to remove an unused component from the app because it is written purely with OpenSSL 3.0 APIs, but it does work. Someone tried it with either boringSSL or wolfSSL, can't remember which. It just needs to be OpenSSL 1.X compatible.

Zero3K commented 4 months ago

It won't be done by me.

Zero3K commented 4 months ago

What is the point of the latest commit?

iProgramMC commented 4 months ago

Irrelevant to the issue at hand, but this fixes a bug that ended up causing MinGW builds of Discord Messenger to always report security errors.

Zero3K commented 4 months ago

Okay. Maybe you could try switching to a different SSL library or just wait for someone else to try. Because its looking like there's a bug in the version of OpenSSL that you are using.

Zero3K commented 4 months ago

image

That is the only error code that I am getting when using the build GitHub Actions made from the latest commit.

Zero3K commented 4 months ago

Along with some errors not giving the SSL error code (but I think that code is the same as what is pictured).

Zero3K commented 4 months ago

Is that error fixable or not?