[LINUX] curl: (60) What to do when Issuer certificate is invalid.

--Environment - Red Hat Enterprise Linux Server release 7.7 (Maipo) - curl 7.29.0 (x86_64-redhat-linux-gnu)

Event: I got angry when I curl https

$ curl https://localhost
curl: (60) Issuer certificate is invalid.
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

Cause: There is a problem with certificate validation with SSL

If this HTTPS server uses a certificate signed by a CA represented in the bundle, the certificate verification probably failed due to a problem with the certificate (it might be expired, or the name might not match the domain name in the URL).
(Translation)Certificate issues if this HTTPS server uses the certificate signed by the CA shown in the bundle(It may have expired or the name may not match the domain name in the URL)Certificate validation may have failed due to.

Action: Do not verify certificate with -k or --insecure option

If you'd like to turn off curl's verification of the certificate, use the -k (or --insecure) option.
(Translation)If you want to turn off certificate validation with curl,-k (Or--insecure)Use the option.

I could see the URL properly


$ curl --insecure https://localhost
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
...abridgement...
</body></html>

Other actions: Prepare a certificate

-[curl] HTTPS communication not possible (unable to get local issuer certificate) --noknow -[When I access an SSL site with the openssl version of curl, I get a "SSL certificate problem: unable to get local issuer certificate" error](https://www.ipentec.com/document/software-curl-error-ssl -certificate-problem-unable-to-get-local-issuer-certificate)

Recommended Posts

curl: (60) What to do when Issuer certificate is invalid.
What to do when Ubuntu crashes
What to do when Japanese is not displayed on matplotlib
What to do when PyCharm font is strange or garbled
What to do when "Invalid HTTP_HOST header" appears in Django
What to do when the value type is ambiguous in Python?
What to do when the result downloaded via scrapy is in English
What to do when pyinstaller: error: argument --add-binary: invalid add_data_or_binary value: appears
[Python] What to do when an error related to SSL authentication is returned
What to do when the warning "The environment is in consistent ..." appears in the Anaconda environment
What to do when a warning message is displayed in pip list
What to do when PermissionError of tempfile.mkstemp occurs
What to do if CERTIFICATE_VERIFY_FAILED occurs when nltk.download () is done on macOS pyhon
What to do if abort is displayed when inputting camera video in OpenCV
[EC2] What to do when selenium is stuck and processing does not proceed
[Go 1.13] What to do when unexpected directory layout: appears
[openpyxl] What to do when IllegalCharacterError appears in pandas.DataFrame.to_excel
What to do when gdal_merge creates a huge file
What to do when raise ValueError, "unsupported hash type"
What to do when "cannot import name xxx" [Python]
pipenv shell is no longer available ... what to do?
What to do if pyenv is not enabled (zsh)
What to do when you can't bind CaboCha to Python
[Python] Type Error:'WebElement' object is not iterable What to do when an error occurs
What to do when is not in the sudoers file.This incident will be reported.
[Python] What to do when No module named'pyproj.datadir' appears when Exe is done with PyInstaller
What to do when only the window is displayed and nothing is displayed in pygame Note
[AWS] What to do when you want to pip with Lambda
What to do when a Remove Error occurs when updating conda
What to do when Unalignable boolean Series provided as indexer
What to do when an error occurs with import _ssl
What to do if package installation fails when deploying to heroku
What to do when "SSL: CERTIFICATE_VERIFY_FAILED _ssl.c: 1056" appears in Python
OSError: [Errno 40] What to do when Message too long appears
Why django-import-export import is so slow and what to do
ImportError: No module What to do when you are told
What to do when there is no response due to Proxy setting in Python web scraping
What to do when a Missing artifact occurs in a jar that is not defined in pom.xml
[Beginner] What to do when "[Errno 2] File b'test.csv' does not exist: b'test.csv" is displayed when reading pandas csv
[AWS] What to do when the ping command causes a "timeout"
What to do if yum breaks
What to do with Magics install
[virtualbox] What to do when [Could not retrieve mirrorlist] appears when yum update is performed on CentOS7
When it is troublesome to copy what you built with vue
What to do when a video cannot be read by cv2.VideoCapture
[Beanstalk] What to do when an error occurs with import uuid
What to do when the jupyterlab extension settings are not reflected
What to do with PYTHON release?
What to do if Insecure Platform Warning appears when running Python
What to do if "Unnamed: 0" is added in to_csv-> read_csv in pandas
What to do if the inode is exhausted on EC2 Linux
What to do when a part of the background image becomes transparent when the transparent image is combined with Pillow
What to do when you get "I can't see the site !!!!"
What to do when UnicodeDecodeError occurs during read_csv in pandas (pd.read_table ())
What to do to get tensorflow-gpu to work
What to do when ModuleNotFoundError: No module named'XXX' occurs in Python
NameError: global name'dot_parser' is not defined and what to do when it comes up in python
[Mac OS] What to do when Python is not installed as a framework. Is displayed when import matplotlib is performed.
[Python] What to do when PEP8 is violated in the process of importing from the directory added to sys.path
What to do when "Something is already running at port 8000" is displayed when the develop command of Gatsby is executed.
How to write what to do when an application is first displayed in Qt for Python with Designer