kinnay / SMB35

An open source server for Super Mario Bros. 35
GNU Affero General Public License v3.0
180 stars 24 forks source link

IPS Patch #1

Closed PhynixP closed 3 years ago

PhynixP commented 3 years ago

Hello, can you help me please to create an ips patch for my domain?

kinnay commented 3 years ago

If you want to host the server on your own domain, just replace this part by your own domain:

image

Also change the domain name here: https://github.com/kinnay/SMB35/blob/master/source/main.py#L196

PhynixP commented 3 years ago

Hello, the domain in main.py i have chanced but the ips file don't work. Can you please add the domain bluephynix.de to the ips file ?

kinnay commented 3 years ago

No please do that yourself. Don't forget to change the first two bytes (00 15). These are the length of the server name, including the null terminator.

This might work, assuming you are hosting the server at port 20000:

image

PhynixP commented 3 years ago

It is not working i have all my file rewrite with the 00 14, but all testfiles are not working. I really don't know what to do right now. I Hope you can help me please!

kinnay commented 3 years ago

I will need a few more details to help you. Does it work if you use the original patch (i.e. the patch that connects to smb35.ymar.dev)? Also, what does "not working" mean? Do you see an error dialog on your Switch? If yes, what's the error code?

Also, it is important that you have the latest version of the game (it should say Ver. 1.0.2 in the top left corner on the title screen).

PhynixP commented 3 years ago

Hello, thank you for your help. I have the Patch 1.0.2 installed an the Switch. Your original IPS-Patch ist working great on my Switch to your test Server. With my newest IPS-Patch i have the Error-Code: 2306-0502 With my old IPS-Patch Files the Switch is on start the Game crashed to the fuse-primary payload.

kinnay commented 3 years ago

Okay, the error code means Transport::ConnectionFailure, so for some reason the game can't connect to your server. Your newest IPS patch is probably good, but something is wrong with your server setup. A few questions to think about:

I hope this helps.

PhynixP commented 3 years ago

I have a update: The switch apparently connects to the server.

But the Server is calling follow error in the bash-console: Traceback (most recent call last): File "/home/smb35/anynet/util.py", line 86, in catch yield File "/home/smb35/anynet/tls.py", line 275, in handle stream = await anyio.streams.tls.TLSStream.wrap( File "/usr/local/lib/python3.9/site-packages/anyio/streams/tls.py", line 94, in wrap await wrapper._call_sslobject_method(ssl_object.do_handshake) File "/usr/local/lib/python3.9/site-packages/anyio/streams/tls.py", line 100, in _call_sslobject_method result = func(*args) File "/usr/local/lib/python3.9/ssl.py", line 944, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:1123) INFO:anynet.http:Received HTTP request: GET / INFO:anynet.http:Sending HTTP response (200) INFO:anynet.http:Received HTTP request: GET / INFO:anynet.http:Sending HTTP response (200) ERROR:anynet.util:An exception occurred

PhynixP commented 3 years ago

This is the Log im Loglevel=Debug

DEBUG:asyncio:Using selector: EpollSelector INFO:anynet.http:Starting HTTP server at :20001 INFO:anynet.tls:Starting TLS server at 31.172.93.119:20001 INFO:anynet.http:Starting HTTP server at :20002 INFO:anynet.tls:Starting TLS server at 31.172.93.119:20002 DEBUG:nintendo.nex.prudp:Serving PRUDP transport at :20000 INFO:anynet.http:Starting HTTP server at :20000 INFO:anynet.tls:Starting TLS server at 31.172.93.119:20000 INFO:anynet.websocket:Routing WS server at / INFO:nintendo.nex.rmc:Starting RMC server at PRUDP port 1 INFO:nintendo.nex.rmc:Starting RMC server at PRUDP port 2 Server is running! ERROR:anynet.util:An exception occurred Traceback (most recent call last): File "/home/smb35/anynet/util.py", line 86, in catch yield File "/home/smb35/anynet/tls.py", line 275, in handle stream = await anyio.streams.tls.TLSStream.wrap( File "/usr/local/lib/python3.9/site-packages/anyio/streams/tls.py", line 94, in wrap await wrapper._call_sslobject_method(ssl_object.do_handshake) File "/usr/local/lib/python3.9/site-packages/anyio/streams/tls.py", line 100, in _call_sslobject_method result = func(args) File "/usr/local/lib/python3.9/ssl.py", line 944, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:1123) DEBUG:asyncio:Using selector: EpollSelector INFO:anynet.http:Starting HTTP server at :20001 INFO:anynet.tls:Starting TLS server at 31.172.93.119:20001 INFO:anynet.http:Starting HTTP server at :20002 INFO:anynet.tls:Starting TLS server at 31.172.93.119:20002 DEBUG:nintendo.nex.prudp:Serving PRUDP transport at :20000 INFO:anynet.http:Starting HTTP server at :20000 INFO:anynet.tls:Starting TLS server at 31.172.93.119:20000 INFO:anynet.websocket:Routing WS server at / INFO:nintendo.nex.rmc:Starting RMC server at PRUDP port 1 INFO:nintendo.nex.rmc:Starting RMC server at PRUDP port 2 Server is running! ERROR:anynet.util:An exception occurred Traceback (most recent call last): File "/home/smb35/anynet/util.py", line 86, in catch yield File "/home/smb35/anynet/tls.py", line 275, in handle stream = await anyio.streams.tls.TLSStream.wrap( File "/usr/local/lib/python3.9/site-packages/anyio/streams/tls.py", line 94, in wrap await wrapper._call_sslobject_method(ssl_object.do_handshake) File "/usr/local/lib/python3.9/site-packages/anyio/streams/tls.py", line 100, in _call_sslobject_method result = func(args) File "/usr/local/lib/python3.9/ssl.py", line 944, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:1123)

DEBUG:anynet.http:New HTTP connection: 89.182.154.165:49414 INFO:anynet.http:Received HTTP request: GET / INFO:anynet.http:Sending HTTP response (200) DEBUG:anynet.tls:Closing TLS connection

I have the SSLCerticate from Lets encrypt (Plesk-App)

ssl

kinnay commented 3 years ago

The game doesn't accept your server certificate. That's really weird though, because my smb35.ymar.dev certificate is signed by Let's Encrypt too, and you said that it works fine on smb35.ymar.dev. I'll let you know if I come up with any ideas, but for now I'm clueless.

kinnay commented 3 years ago

Hmm curl doesn't accept the certificate for some reason:

image

This explains why it doesn't work on your Switch, because the game uses curl internally to set up the game server connection.

Still, two things are weird about this:

  1. It works fine on your main website (the one that redirects to google).
  2. The certificate is accepted by all internet browsers I tried.

Especially 2 is weird. I don't understand why curl is different from web browsers.

kinnay commented 3 years ago

I might have an idea. When you requested the certificate from Let's Encrypt you probably got 4 different pem files. You have to use fullchain.pem for the SMB35 server. It will not work if you use cert.pem, because cert.pem does not contain the intermediate CAs. Can you check if you used the correct certificate file?

image

PhynixP commented 3 years ago

Thank you very mich. This is the Problem. I have add the the normal Cert. Iam at work . i will test it laser or tomorrow

PhynixP commented 3 years ago

Very very thank you for YouTube helpdesk and for the mega Server Tools and libs. The Connection works now.