Hello @udvaritibor and welcome!
Try installing also ca-certificates package (Common CA certificates) or whatever is such package called in Alpine (unfortunately I don’t know). This usually helps when you have issues with certificates.
Edit: ah, I see now that the second image is using buster-slim as base image, so the above name should absolutely work.
Hope it helps!