JSSEHelper API를 사용하여 아웃바운드 SSL 구성을 프로그램으로 지정
WebSphere® Application Server는 아웃바운드 연결을 하기 전에 어떤 SSL(Secure Sockets Layer)을 사용할지를 프로그래밍 방식으로 지정하는 방법을 제공합니다. com.ibm.websphere.ssl.JSSEHelper 인터페이스는 SSL 구성 처리를 위해 API(Application Programming Interface)의 전체 세트를 제공합니다.
이 태스크 정보
아웃바운드 연결을 하기 전에 어떤 SSL(Secure Sockets Layer)을 사용할지를 프로그래밍 방식으로 지정할 때 사용자의 연결 상황에 가장 적합한 방법을 선택하십시오.
프로시저
- JSSEHelper API의 인스턴스를 구하십시오.
com.ibm.websphere.ssl.JSSEHelper jsseHelper = com.ibm.websphere.ssl.JSSEHelper.getInstance();
- WebSphere Application Server 구성으로부터 SSL 특성을 얻거나
사용자의 애플리케이션이 제공하는 특성을 사용하십시오. 다음 옵션 중 하나를 사용하십시오.
- 별명 이름의 방향 선택으로서 다음 예에서처럼
동일 관리 범위 이상 내에서 선택하십시오.
try { String alias = "NodeAServer1SSLSettings"; // As specified in the WebSphere SSL configuration Properties sslProps = jsseHelper.getProperties(alias); } catch (com.ibm.websphere.ssl.SSLException e) { e.printStackTrace(); // handle exception }
- 프로그램적, 방향, 동적 아웃바운드 범위 선택(서열 규칙 및 상속을 기반으로)을 위해
getProperties API를 사용.
SSL 런타임은 특정 프로토콜에 어떤 SSL 구성을 사용할지를 판별하기 위해 getProperties API를 사용합니다. 이 의사결정은 입력(sslAlias and connectionInfo)
및 특성이 호출되는 관리 범위 모두를 기반으로 합니다. getProperties API는 다음 순서로 의사결정을 내립니다.
- API는 특성이 이미 존재하는지를 확인하기 위해 스레드를 확인합니다.
- API는 ENDPOINT_NAME, REMOTE_HOST 및/또는 REMOTE_PORT와 일치하는 동적 아웃바운드 구성을 확인합니다.
- API는 선택적 sslAlias 특성이 지정되는지를 확인하기 위해 검사합니다. 직접적이나 중앙에 관리된 것으로서 프로토콜을 구성할 수 있습니다. 프로토콜이 직접으로 구성되면 sslAlias 매개변수는 null입니다. 프로토콜이 중앙에서 관리되는 것으로 구성되면 sslAlias 매개변수는 또한 null입니다.
- 선택사항이 작성되지 않는 경우에는 API는 이것이 호출되었던 관리 범위를 기반으로 동적 아웃바운드 구성을 선택합니다. 동적 아웃바운드 구성이 동일 범위에 정의되지 않으면 이는 이를 찾기 위해 계층 구조를 검색합니다.
마지막 선택사항은 셀 유효범위 SSL 구성(안에 WebSphere Application Server, Network Deployment) 또는(기본적 Application Server에서) 노드 유효범위 SSL 구성입니다. com.ibm.websphere.ssl.SSLConfigChangeListener 매개변수는 getProperties API에 대한 호출에 의해 선택되는 SSL 구성이 변경될 때 알림을 받습니다. 그런 다음 프로토콜은 API를 다시 호출하여 다음 예에서처럼 새 특성을 구할 수 있습니다.
try { String sslAlias = null; // The sslAlias is not specified directly at this time. String host = "myhost.austin.ibm.com"; // the target host String port = "443"; // the target port HashMap connectionInfo = new HashMap(); connectionInfo.put(JSSEHelper.CONNECTION_INFO_DIRECTION, JSSEHelper.DIRECTION_OUTBOUND); connectionInfo.put(JSSEHelper.CONNECTION_INFO_REMOTE_HOST, host); connectionInfo.put(JSSEHelper.CONNECTION_INFO_REMOTE_PORT, Integer.toString(port)); connectionInfo.put(JSSEHelper.CONNECTION_INFO_ENDPOINT_NAME, JSSEHelper.ENDPOINT_IIOP); java.util.Properties props = jsseHelper.getProperties(sslAlias, connectionInfo, null); } catch (com.ibm.websphere.ssl.SSLException e) { e.printStackTrace(); // handle exception }
- 사용자의 자신의 SSL 특성을 작성하고
다음 예에서처럼 이를 런타임으로 전달하기:
try { // This is the recommended "minimum" set of SSL properties. The trustStore can // be the same as the keyStore. Properties sslProps = new Properties(); sslProps.setProperty("com.ibm.ssl.trustStore", "some value"); sslProps.setProperty("com.ibm.ssl.trustStorePassword", "some value"); sslProps.setProperty("com.ibm.ssl.trustStoreType", "some value"); sslProps.setProperty("com.ibm.ssl.keyStore", "some value"); sslProps.setProperty("com.ibm.ssl.keyStorePassword", "some value"); sslProps.setProperty("com.ibm.ssl.keyStoreType", "some value"); jsseHelper.setSSLPropertiesOnThread(sslProps); } catch (com.ibm.websphere.ssl.SSLException e) { e.printStackTrace(); // handle exception }
- 별명 이름의 방향 선택으로서 다음 예에서처럼
동일 관리 범위 이상 내에서 선택하십시오.
- JSSEHelper.setSSLPropertiesOnThread(props)
API를 사용하여 런타임이 동일한 JSSEHelper.getProperties API를 선택하고 사용할 수 있도록 스레드에서 특성 오브젝트를 설정하십시오. 다음 예에서처럼 jsseHelper.getSSLPropertiesOnThread()
API와 함께 설정된 후 스레드에서 특성을 구할 수도 있습니다.
try { Properties sslProps = jsseHelper.getProperties(null, connectionInfo, null); jsseHelper.setSSLPropertiesOnThread(sslProps); } catch (com.ibm.websphere.ssl.SSLException e) { e.printStackTrace(); // handle exception }
- 연결이 완료되면 null value to the setPropertiesOnThread
API를 전달하여 스레드로부터 SSL 특성을 지워야 합니다.
try { jsseHelper.setSSLPropertiesOnThread(null); } catch (com.ibm.websphere.ssl.SSLException e) { e.printStackTrace(); // handle exception }


http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=tsec_ssloutconfiguseJSSE
파일 이름:tsec_ssloutconfiguseJSSE.html