CentOS 6 標準のopenldap-serversパッケージでLDAPサーバを構築した環境において、IdPからLDAPサーバにStartTLSで接続する設定について記載します。
LDAPサーバはホスト名 ldaptest1.gakunin.nii.ac.jp
として説明します。 LDAPプロキシサーバ : 複数台LDAPサーバ向けのLDAPプロキシサーバ設定方法 の「LDAPサーバ設定(ldaptest1)」を参考に OpenLDAP
の設定を行ってください。この説明で利用する証明書の情報は「LDAPサーバ設定(ldaptest1)」の設定に準じます。
資料はCentOS 5系で記載されたものであるため、利用するバージョンに合わせて適宜読み替える必要があります。
IdPでは ldap.properties, attribute-resolver.xml
に下記の設定を行います。LDAPサーバのCA証明書は /etc/pki/tls/certs/gakuninca.pem
として配置しています。
(省略)
## Connection properties ##
idp.authn.LDAP.ldapURL = ldap://ldaptest1.gakunin.nii.ac.jp
idp.authn.LDAP.useStartTLS = true
#idp.authn.LDAP.useSSL = false
#idp.authn.LDAP.connectTimeout = 3000
## SSL configuration, either jvmTrust, certificateTrust, or keyStoreTrust
idp.authn.LDAP.sslConfig = certificateTrust ← アンコメント
## If using certificateTrust above, set to the trusted certificate's path
idp.authn.LDAP.trustCertificates = /etc/pki/tls/certs/gakuninca.pem
## If using keyStoreTrust above, set to the truststore path
idp.authn.LDAP.trustStore = %{idp.home}/credentials/ldap-server.truststore
(省略)
<resolver:DataConnector id="myLDAP" xsi:type="dc:LDAPDirectory"
(省略)
<dc:StartTLSTrustCredential id="LDAPtoIdPCredential" xsi:type="sec:X509ResourceBacked">
<sec:Certificate>%{idp.attribute.resolver.LDAP.trustCertificates}</sec:Certificate>
</dc:StartTLSTrustCredential>
</resolver:DataConnector>