일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
- MFA
- OSX
- albumbook
- Xcode
- WebAuthn
- 앨범북
- kmip
- 앱리소스
- MYSQL
- css
- git
- Nodejs
- SSL
- 인증
- 2FA
- OTP
- openssl
- SWIFT
- appres
- fido
- FIDO2
- otpkey
- 안드로이드
- 앱스토어
- SSH
- SwiftUI
- apple
- MSYS2
- 애플
- Android
- Today
- Total
인디노트
eclipse server.xml SSL 인증서 설정 및 클라이언트 인증 방법 본문
<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="/Users/kgy/Desktop/KCS/Entrust/workspace/Servers/keystore"
keystorePass="entrust"/>
<Connector port="8444" protocol="org.apache.coyote.http11.Http11Protocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
clientAuth="true" sslProtocol="TLS"
keystoreFile="/Users/kgy/Desktop/KCS/Entrust/workspace/Servers/keystore"
keystorePass="entrust"
SSLVerifyClient="optional"
SSLVerifyDepth="10"/>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.security.cert.Certificate"%>
<%@ page import="java.security.cert.CertificateParsingException"%>
<%@ page import="java.security.cert.X509Certificate"%>
<%@ page import="java.util.Collection"%>
<%@ page import="java.util.List"%>
<%
X509Certificate[] certs = (X509Certificate[])request.getAttribute("javax.servlet.request.X509Certificate");
if (null != certs && certs.length > 0) {
out.println("cert found count " + certs.length + "<br>");
X509Certificate cert = certs[0];
out.println("getIssuerDN() = " + cert.getIssuerDN() + "<br>");
out.println("getSubjectDN() = " + cert.getSubjectDN() + "<br>");
out.println("getSerialNumber() = " + cert.getSerialNumber() + "<br>");
out.println("getVersion() = " + cert.getVersion() + "<br>");
Collection<?> subjectAltNames = cert.getSubjectAlternativeNames();
if(subjectAltNames!=null) {
for (Object subjectAltName : subjectAltNames) {
List<?> entry = (List<?>) subjectAltName;
if (entry == null || entry.size() < 2) {
continue;
}
Integer altNameType = (Integer) entry.get(0);
out.println("altNameType " + altNameType);
if (altNameType == null) {
continue;
}
/*
if (altNameType == type) {
String altName = (String) entry.get(1);
if (altName != null) {
result.add(altName);
}
}
*/
}
}
} else {
out.println("cert not found");
}
%>
'개발 플랫폼 및 언어' 카테고리의 다른 글
OS-X openvpn server 설치 (0) | 2018.05.18 |
---|---|
Virtualbox 네트워크 종류와 설정 방법 (0) | 2018.05.18 |
PEM to CRT (0) | 2018.05.04 |
OpenSSL 로 ROOT CA 생성 및 SSL 인증서 발급 (0) | 2018.05.04 |
리눅스 timezone 설정 (0) | 2018.05.04 |