CC: Tweaked

CC: Tweaked

59M Downloads

pastebin and wget not working

Weasels30 opened this issue ยท 10 comments

commented

I've googled this issue and can't find anything that will help solve this problem I ran into. I'm attempting to pastebin get some code in a computer on my singleplayer world. I'm using a modpack (FTB Presents Direwold20 1.20) which includes CC:Tweaked version 1.108.4. I checked the computercraft-server.toml file and http API and websocket are both enabled. The only rules I see are as follows:

	host = $private
	#Deny all requests to private IP addresses.
	action = "deny"

	host = "*"
	#Allow all non-denied hosts.
	action = "allow"
	#The maximum size (in bytes) that a computer can download in a single request.
	#Note that responses may receive more data than allowed, but this data will not
	#be returned to the client.
	max_download = 16777216
	#The maximum size (in bytes) that a computer can upload in a single request. This
	#includes headers and POST text.
	max_upload = 4194304
	#The maximum size (in bytes) that a computer can send or receive in one websocket packet.
	max_websocket_message = 131072
	#Enable use of the HTTP/SOCKS proxy if it is configured.
	use_proxy = false

I can access pastebin.com in my browser and pastebin get command works perfectly fine in my computercraft emulator (CraftOS-PC). I made a lua program that does the following:

    ok, error, response = http.get("https://pastebin.com/######")
    print(ok)
    print(error)
    print(response)

The output is as follows:

nil
Domain not permitted
nil

What else can I do to troubleshoot this issue? Any assistance would be greatly appreciated!

commented

Thanks for the report! Oh, getting "Cannot create a secure connection" is very odd - that used to happen on ancient versions of Java 8 (so back in the 1.12 days), but I've never seen it on Minecraft 1.20.x.

Just to check, what Minecraft launcher are you using? If you're comfortable doing so, it might be worth updating your Java to the latest Java 17 and seeing if that helps.

Would you be able to try once more and then upload your logs? I'm not optimistic it'll include anything useful, but just in case.

commented

I am playing the latest version of the modpack: FTB Presents Direwolf20 1.20
The launcher I'm using is the FTB App
I currently have the latest version of Java 17 (17.0.10)

Went ahead and booted up my singleplayer world and attempted to pastebin get again. Cannot create a secure connection but I did save the logs. I noticed in the logs some errors handling HTTP response and being unable to find a valid certificate. Is it possible the issue could be with attempting to use HTTP and not HTTPS? Here's the snippet from the logs, if you would like the whole log file I can upload it but I thought I could try to save some time hunting for it.
log.txt

commented

Checking in on this, hoping we can get the pastebin get functionality to work. Is there anything else you need from me on my end?

commented

Sorry for the slow response! I think I wrote a comment earlier, but clearly didn't finish it >_>.

So the issue here appears to be that your Java's certificate store doesn't appear to include certificates for Pastebin. I have no clue why this might be, especially given you're running the latest version of Java!

Doing a search for "unable to find valid certification path to requested target" suggests it might be worth adding -Djavax.net.debug=ssl to your JVM arguments and poking through the output, to check that the right certificate store, etc... is being used. I'm afraid this feels like a problem localised to your computer, so not sure I can be of much help!

commented

I'm afraid I'm going to close this. I'm fairly sure this is an issue with your Java installation (we're just using Java's built-in SSL code here), so not sure there's anything special CC:T can do here.

commented

I'm still unable to get it to work, no matter what I do it says "Could not create a secure connection". Would appreciate any tips on what to do from here!

commented

Are you using a proxy? Is Minecraft configured to use that proxy? Is Computercraft?

commented

No proxy, no VPN and have default configurations on my CC:Tweaked configs.

commented

This error looks like that configuration did not go into effect or you edited wrong file. Did you edit the configuration file can be located at serverconfig/computercraft-server.toml inside the world folder on either single-player or multiplayer ? And was minecraft closed / server shutdown when you edited the file?

commented

I edited the computercraft-server.toml file inside the world folder. I realize the host = $private should have quotes, but I generated a new world and got a fresh config. I try to use pastebin get and it fails and says "Could not create a secure connection". I've been editing the file while in the world then running the /reload command. It seems like the changes go into affect when I do this but if you know for sure that it doesn't then I can close exit the world then make changes. Do you have any suggestions what to do from here?