https://linen.dev logo
Problem with old http client
# help
f
I'm making service that just stores uploaded data in database, and then gives data when it is needed for Garry's mod. Everything works like a charm when testing in browser, postman or curl, but Garry's mod is using old http client from steam (ISteamHTTP) that doesn't support TLS 1.2 (but it supports TLS 1.1). Is there any way to enable support for TLS 1.1 or use http instead of https? Thank you in advance!
g
I googled and found this in a Steam update notes from 10 days ago > Fixed a regression in ISteamHTTP talking to servers with ALPN TLS extensions but no HTTP/2 support https://store.steampowered.com/oldnews/191068 Not sure if this is what was causing your issue
So if you have a steam update pending it could be worth trying
f
Thank you for your research. I had latest version of steam at this time. Tried updating to steam client beta, but still no luck.
Have tried to use ISteamHTTP in c++, and got this response:
Copy code
cpp
LUA_FUNCTION(Test) {
    auto http = SteamHTTP();
    auto utils = SteamUtils();
    auto h = http->CreateHTTPRequest(k_EHTTPMethodGET, "https://rsc-tempx.shuttleapp.rs");
    SteamAPICall_t call = 0;
    if (http->SendHTTPRequest(h, &call)) {
        while (true) {
            SteamAPI_RunCallbacks();
            bool failed = false;
            if (utils->IsAPICallCompleted(call, &failed)) {
                if (failed) {
                    Error("failed\n");
                    break;
                }

                HTTPRequestCompleted_t req;
                if (utils->GetAPICallResult(call, &req, sizeof(req), HTTPRequestCompleted_t::k_iCallback, &failed)) {
                    Msg("YES\n");
                }
                else {
                    Error("noooo\n");
                }
                break;
            }

            std::this_thread::sleep_for(std::chrono::milliseconds(100));
        }
        
    }
    else {
        Error("fail\n");
    }

    return 0;
}
Postman without disabled TLS 1.2 and TLS 1.3:
Postman with disabled TLS 1.2 and TLS 1.3:
> This will be true if the request actually got any sort of response from the server (even an error). > Otherwise it will be false if the request failed due to an internal error or client side network failure. I have got false. I suspect that ISteamHTTP doesn't support TLS 1.2, and can't make successful handshake with
shuttleapp.rs
.
Also what I have discovered, is that Garry's mod uses own steam api library. Gonna ask developer to update steamapi, but I'm afraid he won't in any chance
Yeah, no luck.
g
@kind-area-3810 @stocky-kangaroo-53672 do you have an official answer for this?
f
Alright, the problem was solved by just using a proxy. Made an edge function for netlify
Copy code
ts
export default async (request: Request, context: Context) => {
    const url = new URL(request.url)
    if (url.searchParams.has("proxy.domain")) {
        const domain = url.searchParams.get("proxy.domain") as string
        url.searchParams.delete("proxy.domain")

        url.protocol = "https:"
        url.host = domain

        return fetch(url, request)
            .then(response => {
                console.log(`${context.ip} ${request.method} ${url} -> ${response.status}`)
                return response
            })
    }
}
Works like a charm. Thank you @gentle-ice-1561 for trying help!
2 Views