Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable SSL verification in alpine's apk?

Is there any way to disable SSL verification at installing some packages?

I found how to add my certificate in trusted certificates, but I'd rather do disable this checking.

I need it to avoid following error:

SSL routines:tls_process_server_certificate:certificate verify failed
like image 524
Sardorkhuja Tukhtakhodjaev Avatar asked Dec 11 '25 18:12

Sardorkhuja Tukhtakhodjaev


1 Answers

For Alpine 3.18 and onward, the option --no-check-certificate was added to apk add, so, your best bet is to follow @Chen A.'s answer.


Before Alpine 3.18, that introduced the flag --no-check-certificate in apk add; one way to achieve this was to use an http mirror of the packet repository rather than an https version of it, then you won't have any SSL verification.

So, you could, for example do:

apk add \
  --no-cache \
  --allow-untrusted \
  --repository http://dl-cdn.alpinelinux.org/alpine/v3.15/main \
  alpine-sdk  

To find the right package repository for your version of Alpine, you have a look in the file /etc/apk/repositories.

Here is, for example, the content of the file for the Alpine 3.15 image:

https://dl-cdn.alpinelinux.org/alpine/v3.15/main
https://dl-cdn.alpinelinux.org/alpine/v3.15/community
like image 134
β.εηοιτ.βε Avatar answered Dec 13 '25 09:12

β.εηοιτ.βε



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!