SSL(6)
-
[아파치] 443포트로 접속시 특정 도메인이 아닐경우 원하는 도메인으로 리다렉트 시키기
/etc/httpd/conf.d/ssl.conf ServerName example.co.kr ServerAlias www.example.co.kr SSLEngine on SSLCertificateFile /etc/pki/tls/certs/ssl/ssl.crt SSLCertificateKeyFile /etc/pki/tls/certs/ssl/ssl.key # http로 리다이렉트할 경우 프로그램 처리시 문제될수가 있음 # 서버에 request로 호스트가져올 경우 도메인을 가져오는게 아닌 localhost로 가져옴 # ProxyPass / http://localhost:8081/ # ProxyPassReverse / http://localhost:8081/ Pro..
2023.08.14 -
리눅스(Ubuntu 기준) ssl 사설 인증서 자동갱신 구축하기
ssl 사설인증서 갱신 처리하는 쉘 스크립트 생성 #!/bin/bash CERT_PATH="/.ssl/example.com.cer" # 인증서 경로 KEY_PATH="/.ssl/example.com.key" # 인증서 키 경로 CSR_PATH="/.ssl/example.com.csr" # CSR 경로 # 인증서 생성날짜와 현재날짜 차이 계산 cert_expiry=$(openssl x509 -startdate -noout -in $CERT_PATH | cut -d'=' -f2-) expiry_epoch=$(date +%s -d "${cert_expiry}") today_epoch=$(date +%s) diff=$(expr ${today_epoch} - ${expiry_epoch} ) days_left=$(..
2023.04.27 -
openssl 인증서 자동갱신 쉡 스크립트 만들기
# CSR 정보 설정 COUNTRY=KR STATE=Seoul LOCALITY=Seoul ORG=Seoul UNIT=exampleCompany CN=example.com # CSR 생성 openssl req -new -newkey rsa:2048 -nodes -keyout /.ssl/cert/example.com.key \ -out /.ssl/cert/example.com.csr \ -subj "/C=$COUNTRY/ST=$STATE/L=$LOCALITY/O=$ORG/OU=$UNIT/CN=$CN" openssl x509 -req -days 365 -in /.ssl/cert/example.com.csr -signkey /.ssl/cert/example.com.key -out /.ssl/cert/exampl..
2023.04.26 -
[리눅스] nginx http -> https 세팅 참고 예제
> nginx설치후 아래 설정 적용#user nobody;worker_processes 100; #error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024;} http { include mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' ..
2022.08.22 -
[JAVA] HTTPS통신시 인증서 검증 없이 통신처리하기
코드 제목: SSL 인증서 검증 우회 설정이 코드는 HTTPS 연결을 할 때 SSL 인증서를 검증하지 않도록 설정하는 방법을 보여줍니다. 일반적으로 HTTPS 연결은 서버의 SSL 인증서를 확인하여 해당 서버가 신뢰할 수 있는지 판단합니다. 그러나 이 코드에서는 인증서 검증을 생략하고, 모든 서버 인증서를 신뢰하는 방식으로 설정하고 있습니다. 주로 테스트 환경이나 인증서를 신뢰할 수 없는 서버와의 통신에서 사용할 수 있습니다. 그러나 보안상의 이유로 실제 서비스에서 사용하지 않는 것이 좋습니다.코드 흐름과 설명:1. URL 객체 생성url = new URL(addr);주어진 주소(addr)를 이용해 URL 객체를 생성합니다.이 객체는 우리가 연결하려는 웹사이트나 서버의 주소를 나타냅니다.addr에는 예를..
2022.02.09 -
[리눅스] CentOS 7 https적용하기 (ssl세팅)
openssl로 인증서(crt)와 개인키(key) 생성 하여 특정 경로에 저장 > yum -y install mod_ssl > cd /etc/httpd/conf.d > vi ssl.conf ssl.conf 설정파일 맨 아래에 다음 내용 입력 ServerName {접속 도메인} ServerAlias www.{접속 도메인} SSLEngine on SSLCertificateFile {crt확장자로 되어 있는 인증서 경로}/{인증서명}.crt SSLCertificateKeyFile {key확장자로 되어 있는 인증서 키 경로}/{인증서 키명}.key CustomLog /var/log/httpd/ssl_request_log \ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"..
2022.01.21