Https Loadstring Help

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.

2 Likes

The error is coming from the web app, this isn’t a Roblox-side issue. Perhaps an authentication error?

Maybe. How would I check that/fix that?

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).

Nope, the code is plain on the website. Anyone and any system should be able to read it.

It just reads it from the database and then shows it on the page.

Ok, I did a little more research and found out Tls means Transport Layer Security.

Does the server have a valid TLS certificate? Does the host name in the URL match that on the certificate? Are the certificates up to date?

The server has a ssl certificate wich I got today, but it needs an tls in order to work?

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.

1 Like

Alright, I’ll contact my hosting service to see if that’s possible and will get back in a few days with new results.

2 Likes

Update: I already have a certificate wich is active right now.

Do you know how I can apply for that Certificate?

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.

1 Like

I already have a zerossl certificate. So it should work?

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.

1 Like

I’m using infitefree and I need to upload the certificate and the private key, the CA doesn’t work.