Hi,
I’m wanting to make a website to upload Roblox code and then you can acces that code through loadstring, but I’m getting some issues. When I directly go to my webpage where the code is placed directly, not in any fancy things, it shows the code fine.
But when I go to Roblox and run my code in there, it returns an 19:49:58.301 HTTP request failed: HttpError: TlsVerificationFail - Server - Script:26 error.
My code in Roblox pasted below.
local HttpService = game:GetService("HttpService")
-- Replace 'YOUR_UNIQUE_ID' with the actual unique ID you want to fetch
local uniqueID = "671124a86925a"
local url = "https://roscripts.infinityfreeapp.com/get_code.php?id=" .. uniqueID
local success, response = pcall(function()
return HttpService:GetAsync(url)
end)
if success then
-- Output the response for debugging
print("Response received: " .. response)
-- Use loadstring to execute the retrieved code
local successLoad, result = pcall(loadstring(response))
if successLoad then
print("Code executed successfully.")
else
warn("Error executing code: " .. result)
end
else
warn("HTTP request failed: " .. response)
end
I’ve tried almost everything, but I just can’t find the way to do it. If anyone is able to help I would really appreciate that!
Thanks,
Jopio
PS: Please let me know if any aspect of this post is breaking the TOS. I don’t know if im allowed to post own websites and stuff, so let me know and I will fix it asap.
Check how you’re supposed to make the request to have a successful response(you can test it outside of Roblox), and then try to copy the associated headers and cookies to ensure proper behavior.
Are you using cookies or some sort of API key to authenticate the request? Do you need to put in headers containing this? (Similar to what @NyrionDev said about copying the headers, etc. across, I just noticed you didn’t have any and that could be the issue).
You need a CA (Certificate Authority), after you place the SSL key, you place the CA, after you place it, it will probably be installed and working as normal.
I most use ZeroSSL, its free, easy to use and user-friendly, you can use Let’s Encrypt too and other provider, but everytime i ZeroSSL for this type of case.
It doesnt work so fast, and 2 things, when you download the ssl, it comes with 2 archives, the CA and the Certificate, those 2 need to be placed at the right spot, first the certificate then the CA.
Roblox is pretty strict about TLS (Transport Layer Security) verification for HTTP requests. Your website should use HTTPS with a valid certificate issued by a Certificate Authority so that Roblox can trust it. infinityfreeapp.com, doesn’t really have a trusted SSL certificate by default, so you might want to use a service like Cloudflare, which provides SSL certificates for free. You could also use a service like Glitch or Repl.it, which often have properly configured SSL certificates out of the box, this can make it much easier for Roblox to trust the connection.
Another thing I wanted to mention is that loadstring can be dangerous if the remote code has any issues with it you may accidentally run malicious code. I suggest you limit what code gets executed if your going to use loadstring.