Jump to content

Creating a discord bot, getting ssl errors?

Recommended Posts


I have written a CGI script to start my discord bot and output any errors that may occur, and I keep getting this error:

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)

The full traceback is at https://pastebin.com/jWBLn6x0, sorry everything has the word "line" appended before it, it was how my script outputted the log.
If anyone could help that would be great!

Link to comment
Share on other sites

We do have a tutorial about Discord bots, but it was written when we still used cPanel, so it may need to be adapted.

Anyway, here it goes: https://wiki.helionet.org/tutorials/discord-bot

Since I'm not a Python programmer, I am unable to help much further than that.


@rsa16, I talked with our staff about your case, and one of our root admins recommend that you use that code to solve your error:

import certifi
os.environ["SSL_CERT_FILE"] = certifi.where()


Edited by Kairion
Including possible solution.
Link to comment
Share on other sites

Yeah, that's the exact tutorial I saw. I tried to get it to work on Plesk and I got pretty far except I encountered that error, and now I'm basically clueless. I think it has something to do with an outdated certificate but I'm not sure.

Sorry, I didn't refresh my page and see your edit, thanks for the solution, I'll try and see if it works!

Edited by rsa16
didn't refresh page and see the other edit
Link to comment
Share on other sites

  • 2 months later...

Hi @rsa16

I'm also creating the Bot like you. The tutorial is out of date. What need to change in that tutorial ?
I only change the path to cgi-bin, from "public_html/cgi-bin" to "httpdocs/cgi-bin"

But when I access ...heliohost.us/cgi-bin/start.py, it gives:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.


Also, no log file in 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...