How to get root certificate to download files using gitlab API


tl;dr: Cannot generate root certificate for using echo "" | openssl s_client -showcerts -connect | sed -n "1,/Root/d; /BEGIN/,/END/p". Please help.

I cannot generate root certificate to download files from repositories. So basically I want to a download file (build artifact) from my IoT device. I’m using the Gitlab API and using curl like curl --header "PRIVATE-TOKEN: secret-token" "<my_id>/repository/files/main.bin/raw?ref=main. To get the binary on my device I need a root certificate for HTTPS.

For github I used to command echo "" | openssl s_client -showcerts -connect | sed -n "1,/Root/d; /BEGIN/,/END/p" but echo "" | openssl s_client -showcerts -connect | sed -n "1,/Root/d; /BEGIN/,/END/p" yields nothing. Can someone please tell what am I doing wrong.