File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,15 @@ signing_key
7979expiration_days = 3650
8080EOF"
8181
82+ # The integration server may be accessed by IP address, in which case
83+ # we want some of the IPs included in the cert. We skip loopback (127.0.0.1)
84+ # because that's the IP we use in the integration test for cert name mismatches.
85+ ADDRS=$( ifconfig -a | grep ' inet addr:' | cut -f 2 -d : | cut -f 1 -d ' ' )
86+ for ip in $ADDRS ; do
87+ if [ " x$ip " = ' x127.0.0.1' ]; then continue ; fi
88+ echo " ip_address = $ip " >> /etc/ssl/ldap01.info
89+ done
90+
8291# Create the server certificate
8392certtool --generate-certificate \
8493 --load-privkey /etc/ssl/private/ldap01_slapd_key.pem \
@@ -114,6 +123,9 @@ chmod o-r /etc/ssl/private/ldap01_slapd_key.pem
114123# Drop packets on a secondary port used to specific timeout tests
115124iptables -A INPUT -p tcp -j DROP --dport 8389
116125
126+ # Forward a port for Vagrant
127+ iptables -t nat -A PREROUTING -p tcp --dport 9389 -j REDIRECT --to-port 389
128+
117129# fix up /etc/hosts for cert validation
118130grep ldap01 /etc/hosts || echo " 127.0.0.1 ldap01.example.com" >> /etc/hosts
119131grep ldap02 /etc/hosts || echo " 127.0.0.1 ldap02.example.com" >> /etc/hosts
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
1010 config . vm . box = "hashicorp/precise64"
1111
1212 config . vm . network "private_network" , type : :dhcp
13+ config . vm . network "forwarded_port" , guest : 389 , host : 9389
1314
1415 config . ssh . forward_agent = true
1516
You can’t perform that action at this time.
0 commit comments