IoT Wireless

WizFi250 SSL Test with Self-Signed-Certificate 본문

WiFi module

WizFi250 SSL Test with Self-Signed-Certificate

DH0815 2014. 11. 14. 12:41
오늘은 WizFi250에 기본 저장된 Certificate 대신에 외부의 Certificate를 이용하는 방법에 대해서 설명한다.

WizFi250의 Flash에는 SSL 통신을 위한 기본 Certificate가 포함되어 있다.
Certificate를 생성하고 테스트 하기 위해서 OpenSSL을 이용하였고, 별도의 CA 없이 간단히 Self Signed Certificate를 사용하여 테스트 하였다.
(OpenSSL : http://en.wikipedia.org/wiki/OpenSSL)

1. Self Signed Certificate 생성하기
아래 예제처럼, KR/WIZnet/Steve Kim/유효기간 10년 등의 정보로 SSL 통신을 위한 인증서와 키를 생성하였다.
D:\openssl-test>openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout new-key.key -out new-cert.pem
Loading 'screen' into random state - done
Generating a 2048 bit RSA private key
.+++
..........................+++
writing new private key to 'new-key.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:KR
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:SEOUL
Organization Name (eg, company) [Internet Widgits Pty Ltd]:WIZnet
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:Steve Kim
Email Address []:ssekim@wiznet.co.kr

D:\openssl-test>openssl rsa -in new-key.key -out new-key.pem
writing RSA key



2. 생성된 Certificate(Key)를 WizFi250에 저장하기
WizFi250의 "AT+MCERT" 명령을 이용하여 위에서 생성된 인증서(new-cert.pem)와 키(new-key.pem)를 WizFi250에 저장한다.
AT+MCERT=W,C,1375
[OK]
AT+MCERT=W,K,1675
[OK]

3. 새로 생성한 Self Signed Certificate로 SSL 통신 테스트하기 


참고로, OpenSSL로 인증서 만들기는 아래 링크에도 관련 자료가 있다.
(http://kaizen8501.tistory.com/59)