Tests: added basic ssl tests with dynamic certificate not found.
diff --git a/ssl_certificate.t b/ssl_certificate.t
index 077b5ec..2f3d548 100644
--- a/ssl_certificate.t
+++ b/ssl_certificate.t
@@ -120,6 +120,14 @@
         ssl_certificate $two.crt;
         ssl_certificate_key $two.key;
     }
+
+    server {
+        listen       127.0.0.1:8084 ssl;
+        server_name  localhost;
+
+        ssl_certificate $ssl_server_name.crt;
+        ssl_certificate_key $ssl_server_name.key;
+    }
 }
 
 EOF
@@ -155,7 +163,7 @@
 $t->write_file('password_file', 'pass');
 $t->write_file('index.html', '');
 
-$t->try_run('no ssl_certificate variables')->plan(10);
+$t->try_run('no ssl_certificate variables')->plan(11);
 
 ###############################################################################
 
@@ -179,6 +187,12 @@
 like(get('default', 8081, $ses), qr/default:r/, 'session id context match');
 like(get('default', 8082, $ses), qr/default:\./, 'session id context distinct');
 
+# errors
+
+Net::SSLeay::ERR_clear_error();
+get_ssl_socket('nx', 8084);
+ok(Net::SSLeay::ERR_peek_error(), 'no certificate');
+
 ###############################################################################
 
 sub get {
diff --git a/stream_ssl_certificate.t b/stream_ssl_certificate.t
index 8b3b8ee..b8e0493 100644
--- a/stream_ssl_certificate.t
+++ b/stream_ssl_certificate.t
@@ -103,6 +103,14 @@
         ssl_certificate $two.crt;
         ssl_certificate_key $two.key;
     }
+
+    server {
+        listen       127.0.0.1:8084 ssl;
+        return       $ssl_server_name:$ssl_session_reused;
+
+        ssl_certificate $ssl_server_name.crt;
+        ssl_certificate_key $ssl_server_name.key;
+    }
 }
 
 EOF
@@ -138,7 +146,7 @@
 $t->write_file('password_file', 'pass');
 $t->write_file('index.html', '');
 
-$t->try_run('no ssl_certificate variables')->plan(6);
+$t->try_run('no ssl_certificate variables')->plan(7);
 
 ###############################################################################
 
@@ -160,6 +168,12 @@
 like(get('default', 8081, $ses), qr/:r/, 'session id context match');
 like(get('default', 8082, $ses), qr/:\./, 'session id context distinct');
 
+# errors
+
+Net::SSLeay::ERR_clear_error();
+get_ssl_socket('nx', 8084);
+ok(Net::SSLeay::ERR_peek_error(), 'no certificate');
+
 ###############################################################################
 
 sub get {