반응형
CURL 명령어와 LYNX 명령어로 대상 웹 사이트의 헤더 정보를 살펴볼 수 있습니다.
[root@localhost ~]# yum -y -q install curl
[root@localhost ~]# curl -I http://localhost
HTTP/1.1 302 Found
Date: Tue, 02 Jul 2019 01:08:05 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.3.6
Location: https://www.xxx.xxx
Content-Type: text/html; charset=iso-8859-1
[root@localhost ~]# yum -y -q install lynx
[root@localhost ~]# lynx -head -mime_header http://localhost
HTTP/1.1 302 Found
Date: Tue, 02 Jul 2019 01:08:19 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.3.6
Location: https://www.xxx.xxx
Connection: close
Content-Type: text/html; charset=iso-8859-1
다만, HTTPS 프로토콜에 대해서는 정상적으로 SSL 인증서가 설치되어 있지 않을 경우, 아래와 같은 에러가 발생할 수 있습니다.
[root@localhost ~]# curl -I 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.
[root@localhost ~]# lynx -head -mime_header https://localhost
Looking up localhost
Making HTTPS connection to localhost
SSL callback:unable to get local issuer certificate, preverify_ok=0, ssl_okay=0
Retrying connection without TLS.
Looking up localhost
Making HTTPS connection to localhost
Alert!: Unable to make secure connection to remote host.
lynx: Can't access startfile https://localhost/
반응형
'Server > Linux' 카테고리의 다른 글
firewall-cmd --new-service (0) | 2020.10.08 |
---|---|
[BIND] CentOS 7에서 DNS 설치 (0) | 2020.07.17 |
Linux tar (0) | 2019.06.26 |
Ubuntu 고정 IP 설정 (0) | 2019.02.07 |
Change the time zone on Linux (0) | 2018.11.07 |