A.6. Elytron 클라이언트 측 두 가지 방법 예


서버 SSL 컨텍스트를 구성한 후 가능한 경우 구성을 테스트하는 것이 중요합니다. Elytron 클라이언트 SSL 컨텍스트를 구성 파일에 배치한 다음 관리 CLI에서 실행하여 서버 구성을 테스트할 수 있습니다. 이 단계에서는 서버 측 구성이 완료되었으며 필요한 경우 서버가 다시 로드되었다고 가정합니다.

  1. 서버 및 클라이언트 키 저장소가 이미 있는 경우 다음 단계로 진행합니다. 그렇지 않으면 서버와 클라이언트 키 저장소를 생성합니다.

    $ keytool -genkeypair -alias localhost -keyalg RSA -keysize 1024 -validity 365 -keystore server.keystore.jks -dname "CN=localhost" -keypass secret -storepass secret
    $ keytool -genkeypair -alias client -keyalg RSA -keysize 1024 -validity 365 -keystore client.keystore.jks -dname "CN=client" -keypass secret -storepass secret
  2. 서버 및 클라이언트 인증서가 이미 내보낸 경우 다음 단계로 진행합니다. 그렇지 않으면 서버와 클라이언트 인증서를 내보냅니다.

    $ keytool -exportcert  -keystore server.keystore.jks -alias localhost -keypass secret -storepass secret -file server.cer
    $ keytool -exportcert  -keystore client.keystore.jks -alias client -keypass secret -storepass secret -file client.cer
  3. 서버 인증서를 클라이언트의 신뢰 저장소로 가져옵니다.

    $ keytool -importcert -keystore client.truststore.jks -storepass secret -alias localhost -trustcacerts -file server.cer
  4. 클라이언트 인증서를 서버의 신뢰 저장소로 가져옵니다.

    $ keytool -importcert -keystore server.truststore.jks -storepass secret -alias client -trustcacerts -file client.cer
  5. example-security.xml 내부에 클라이언트 측 SSL 컨텍스트를 정의합니다. 이 구성 파일에는 아웃바운드 연결에 대한 인증 및 SSL 구성을 정의하는 Elytron authentication-client 가 포함되어 있습니다. 다음 파일은 클라이언트 SSL 컨텍스트 및 키 저장소를 정의하는 방법을 보여줍니다.

    <?xml version="1.0" encoding="UTF-8"?>
    
    <configuration>
        <authentication-client xmlns="urn:elytron:client:1.2">
            <key-stores>
                <key-store name="clientStore" type="jks" >
                    <file name="/path/to/client.truststore.jks"/>
                    <key-store-clear-password password="secret" />
                </key-store>
            </key-stores>
            <key-store name="clientKeyStore" type="jks" >
                <file name="/path/to/client.keystore.jks"/>
                <key-store-clear-password password="secret" />
            </key-store>
            <ssl-contexts>
                <ssl-context name="client-SSL-context">
                    <trust-store key-store-name="clientStore" />
                    <key-store-ssl-certificate key-store-name="clientKeyStore" alias="client">
                        <key-store-clear-password password="secret" />
                    </key-store-ssl-certificate>
                </ssl-context>
            </ssl-contexts>
            <ssl-context-rules>
                <rule use-ssl-context="client-SSL-context" />
            </ssl-context-rules>
        </authentication-client>
    </configuration>
  6. 관리 CLI를 사용하여 새로 생성된 파일을 참조하고 서버에 액세스해 봅니다. 다음 명령은 관리 인터페이스에 액세스하고 whoami 명령을 실행합니다.

    $ EAP_HOME/bin/jboss-cli.sh -c --controller=remote+https://127.0.0.1:9993 -Dwildfly.config.url=/path/to/example-security.xml :whoami





2024-02-09에 최종 업데이트된 문서

Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat
맨 위로 이동