개발이야기 027. talkit.bank https 전환 관련 방법 - Let's Encrypt

in #kr16 days ago


안녕하세요 @talkit.bank 입니다.

은행 서비스는 가장 큰 기능 중의 하나가 보안 입니다.

그래서 SSL을 적용 했습니다.

Let's Encrypt라고 무료 SSL을 적용했습니다.

Ubuntu를 사용할것이기 때문에 리눅스에서 진행 했습니다.

sudo apt install certbot

certbot이라는 앱을 설치해줍니다.

80
443

위 포트로 열려 있는 서비스를 잠깐 죽여야 합니다.

sudo certbot certonly --standalone -d example.com --agree-tos --email [email protected] --non-interactive

위 명령어로 인증서를 받을 수 있습니다.

인증서를 받으면 리눅스라고 생각하고

/etc/letsencrypt/live/example.com/fullchain.pem
/etc/letsencrypt/live/example.com/privkey.pem

위 위치에 존재 합니다.

if __name__ == "__main__":
    context = (
        "/etc/letsencrypt/live/example.com/fullchain.pem",
        "/etc/letsencrypt/live/example.com/privkey.pem"
    )
    app.run(host="0.0.0.0", port=443, ssl_context=context)

python 코드는 위와 같이 수정 합니다.

sudo -i
cd 원하는 경로
conda activate steemit
nohup python3 app.py &

위와 같이 해주면 443포트로 서비스가 동작 합니다.

https://talkitbank.whd.kr/home

제가 이번에 가오픈한 talkitbank 서비스도 https로 잘 동작하고 있습니다.

감사합니다.



Posted through the ECblog app (https://blog.etain.club)

Sort:  

Upvoted! Thank you for supporting witness @jswit.

암요!
은행서비스인데, https 로 가야죠~! 👍👍👍 ^^

네 맞습니다. https ^^ 요즘은 Let's Encrypt 때문에 잘 살고 있씁니다. ^^