echo "Checking SSL connection between Pgpool-II and backend was ok."
./shutdownall
+
+# Checking ssl_ecdh_curve. Set bad value to see if SSL connection fails.
+echo "ssl_ecdh_curve = 'badcurve'" >> etc/pgpool.conf
+
+./startall
+wait_for_pgpool_startup
+
+$PSQL -h localhost test <<EOF > result
+\conninfo
+\q
+EOF
+
+grep SSL result
+
+if [ $? = 0 ];then
+ echo "Checking SSL connection between frontend and Pgpool-II succeeded despite bad ssl_ecdh_curve."
+ ./shutdownall
+ exit 1
+fi
+
+echo "Checking SSL connection between frontend and Pgpool-II failed due to bad ssl_ecdh_curve as expected."
+./shutdownall
+
+# Make sure that SSL connection succeeds with good ssl_ecdh_curve
+echo "ssl_ecdh_curve = 'prime256v1'" >> etc/pgpool.conf
+
+./startall
+wait_for_pgpool_startup
+
+$PSQL -h localhost test <<EOF > result
+\conninfo
+\q
+EOF
+
+grep SSL result
+
+if [ $? = 0 ];then
+ echo "Checking SSL connection between frontend and Pgpool-II succeeded with good ssl_ecdh_curve."
+ ./shutdownall
+else
+ echo "Checking SSL connection between frontend and Pgpool-II failed with good ssl_ecdh_curve."
+ ./shutdownall
+ exit 1
+fi
+
exit 0