본문 바로가기

쓰기

apache ssl 인증시 error

haru 2017.11.28 10:25 조회 수 : 1

# openssl s_client -connect xxx.xxx:443 < /dev/null 2>&1 | openssl x509 -noout -enddate


unable to load certificate
20440:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:647:Expecting: TRUSTED CERTIFICATE

 

# echo "" | openssl s_client -connect harulife.co.kr:443 | openssl x509 -noout -dates


20437:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:588:
unable to load certificate
20438:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:647:Expecting: TRUSTED CERTIFICATE

 

ssl 인증서 설치중 적용이 안되어 위와같이 인증서를 불러오는 테스트를 진행하여도 받아오질 못하고있었습니다.

 

위와같은 상황에서 apachectl -S 를 통하여 확인하였을시

 

# /etc/init.d/apachectl -S
VirtualHost configuration:
115.68.74.248:*        is a NameVirtualHost
         default server harulife.co.kr (/usr/local/apache/conf/httpd.conf:489)
         port * namevhost harulife.co.kr (/usr/local/apache/conf/httpd.conf:489)
         port * namevhost test.harulife.co.kr (/usr/local/apache/conf/httpd.conf:501)
         port * namevhost test2.harulife.co.kr (/usr/local/apache/conf/httpd.conf:510)
         port * namevhost abc.harulife.co.kr (/usr/local/apache/conf/httpd.conf:548)
         port * namevhost dfs.harulife.co.kr (/usr/local/apache/conf/httpd.conf:557)
wildcard NameVirtualHosts and _default_ servers:
_default_:443          *.harulife.co.kr (/usr/local/apache/conf/extra/httpd-ssl.conf:74)
Syntax OK

 

위와같이 나오고있었습니다.

port 부분이 * 로되어있어 위부분을 이상하게 여기고

 

/usr/local/apache/conf/httpd.conf 부분에서

 

NamevirtualHost 115.68.74.248

 

<VirtualHost 115.68.74.248>

    DocumentRoot /haru/haru/haru
    ServerName test.harulife.co.kr


</VirtualHost>

 

위와같이 되어있는 부분을

 

NamevirtualHost *:80

 

<VirtualHost *:80>

    DocumentRoot /haru/haru/haru
    ServerName test.harulife.co.kr


</VirtualHost>

 

으로 수정한뒤 

 

# /etc/init.d/apachectl -S
VirtualHost configuration:
*:80        is a NameVirtualHost
         default server harulife.co.kr (/usr/local/apache/conf/httpd.conf:489)
         port 80 namevhost harulife.co.kr (/usr/local/apache/conf/httpd.conf:489)
         port 80 namevhost test.harulife.co.kr (/usr/local/apache/conf/httpd.conf:501)
         port 80 namevhost test2.harulife.co.kr (/usr/local/apache/conf/httpd.conf:510)
         port 80 namevhost abc.harulife.co.kr (/usr/local/apache/conf/httpd.conf:548)
         port 80 namevhost dfs.harulife.co.kr (/usr/local/apache/conf/httpd.conf:557)
wildcard NameVirtualHosts and _default_ servers:
_default_:443          *.harulife.co.kr (/usr/local/apache/conf/extra/httpd-ssl.conf:74)
Syntax OK

 

위와같이 변경되며 ssl적용이 되었다.