Error in requester, discord java bot

Question:How i can fix it or what i need to do with java

Repl link: mybotdsmiw - Replit

Hello! im trying to host for a test a discord music bot i found in github, in 2020/2021 i tried it an worked but now java is saying this error:

[12:41:12] [ERROR] [Requester]: There was an I/O error while executing a REST request: PKIX path building failed: unable to find valid certification path to requested target

i searched and i founded a certificate issue or something like that but idk what to do

You can use the openssl command to retrieve the certificate by using this:

echo -n | openssl s_client -connect | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/mycert.pem

Usually he will download the certificate in your home directory so use ls ~/ command in shell to see the file.

1 Like

Also, check this too:

1 Like

yeah, i saw that, but is just for testing and in my previous experience was fine.

i used the command and printed something but just i dont see the certificate and the bot is saying the same

You have to move the file from your home directory to the root directory of your project.

If you use the command ls ~/ in shell you will see the files of your home directory, than you use mv to move the file from your home to your project directory.

(of course assuming that you downloaded the certificate with the command)

I forked your project.

If I use the command ls in shell it will bring this:

~/Test1$ ls
config.txt  JMusicBot-0.3.9.jar  replit.nix  secret.png

After that I use the command:

echo -n | openssl s_client -connect | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/mycert.pem

It still not gonna show up in ls. That’s why we use ls ~/ to check your home directory:

~/Test1$ ls ~/
mycert.pem  Test1

After that you can move the file to your directory by using mv.

mv ~/mycert.pem .

Now the file is in my directory:

1 Like

i trited that but just dont work, i followed the steps and i moved the mycert.pem but is the same error.

Well, that’s how you download the certificate.

Maybe you need to make the certificate being trust by replit but that’s beyond my help.

@QwertyQwerty88 or @UMARismyname any clues on this?

1 Like

looks similar to this:

:man_shrugging: all I can say is: make sure you aren’t making too many requests (like spamming, mass delete) or trying to do things on channels/roles without appropriate permissions

1 Like