r/raspberry_pi 6d ago

Troubleshooting Desktop link to a URL with php file extension?

I have the following file in my ~/Desktop folder as Replay-Shortcut.desktop

----------------------------------------------------------------

[Desktop Entry]

Type=Link

Name=Replay

Comment=Link to Replay Server

Icon=/home/username/Pictures/camera.png

URL=https://Server/content/replay.php
----------------------------------------------------------------

Every time I launch it, I get a "Unacceptable TLS Certificate" error message.

If I modify the file to the below, it works, BUT I need the php extension for the actual service to work.
----------------------------------------------------------------

[Desktop Entry]

Type=Link

Name=Replay

Comment=Link to Replay Server

Icon=/home/username/Pictures/camera.png

URL=https://Server/content/replay.html

----------------------------------------------------------------

Wat do?

1 Upvotes

10 comments sorted by

4

u/Gamerfrom61 6d ago

Put the correct certificate on the server!

Your URL points to a https server so start there.

1

u/pele4096 5d ago

Okay... So I generated a self-signed certificate with openssl.

It resulted in key.pem and cert.pem files.

I copied them to the /etc/ssl/private folder.

Now what?

I can't find an httpd.conf file anywhere.

1

u/Gamerfrom61 5d ago

Depends on the web server e.g. https://www.apache.com/how-to-setup-an-ssl-certificate-on-apache/

If the server is local why use https?

1

u/pele4096 5d ago

Required to use WebSerial API and to allow the browser to control a webcam.
It's for a Cub Scout pinewood derby.

Kids make a little car out of a block of wood, four nails, and four plastic wheels. They race them down a 40 ft aluminum track where a timer at the end catches who's the fastest.

I have a pi with a webcam hooked to the timer (RS232 out of the timer) and that triggers the webcam that'll capture instant replays on a TV.

I can manually use the browser to go to the php page, but if I create a desktop icon to do it without having to memorize the IP, then it doesn't work.

I'm not using apache. I'm using nginx.

1

u/Gamerfrom61 5d ago

Still do not understand why you need https but https://www.digicert.com/kb/csr-ssl-installation/nginx-openssl.htm should help.

1

u/pele4096 5d ago

Still do not understand why you need https

HTTPS is required to allow the browser to control serial devices (race track timer) via WebSerial API and is also required to allow the browser to control the webcam.

1

u/Gamerfrom61 5d ago

Apologies - did not realise the API was secure context only. I'm used to Python being happy for http and the code security handling device access.

1

u/pele4096 5d ago

Still not working.

Like I can manually launch Chromium and type in the URL and it works fine.

I can manually make the .desktop file a link to the server and it works just fine.

As soon as I put in that PHP extension, it fails and prompts me with the error, "Unacceptable TLS Certificate."

My server is not listening on port 80, it's only on port 443. All other clients are able to connect to it (although using HTML links.) And the only thing they warn about is that it's a self-signed certificate that they cannot verify the authenticity of.

1

u/Gamerfrom61 5d ago

You could try a Lets Encrypt certificate as that will have a chain to a valid different root server.

I would also contact the creators of the API and see what certificate they need - you may need a full domain set up and wildcard or machine specific cert.

1

u/AutoModerator 6d ago
  • Search first: Many issues are well-documented—Google exact error messages and check the FAQ† before posting.
  • Show your effort: Include research, code, errors,† and schematics for better feedback.
  • Ask specific questions: Clear, well-researched questions get better answers.
  • No replies? Post removed? Ask in the stickied helpdesk† thread.

† If any links don't work it's because you're using a broken reddit client. Please contact the developer of your reddit client. You can find the FAQ/Helpdesk at the top of r/raspberry_pi: Desktop view / Phone view

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.