run-tls.sh 401 B

12345678910111213141516
  1. #!/bin/sh
  2. runOptions="--dns=127.0.0.1 -v `pwd`/test/ssl:/etc/ldap/ssl"
  3. . $dir/tools/run-simple.sh
  4. cert=$(echo $dir/ssl/ldap.crt)
  5. certCN=$(openssl x509 -in $cert -subject -noout | sed -n 's/.*CN=\(.*\)\/*\(.*\)/\1/p')
  6. addLine=$(echo $IP $certCN)
  7. echo $addLine >> /etc/hosts
  8. cp /etc/ldap/ldap.conf /etc/ldap/ldap.conf.old
  9. sed -i 's,TLS_CACERT.*,TLS_CACERT '"$cert"',g' /etc/ldap/ldap.conf
  10. sleep 5