+// Finish using an SSL handle; shut down the connection and free the
+// handle.
+void ssl_finish(SSL *ssl)
+{
+ //
+ // We won't be using this again, so we can just send the
+ // shutdown alert and free up the handle, and have our
+ // caller close the socket.
+ //
+ // XXX - presumably, if the connection is shut down on
+ // our side, either our peer won't have a problem sending
+ // their shutdown alert or will not treat such a problem
+ // as an error. If this causes errors to be reported,
+ // fix that as appropriate.
+ //
+ SSL_shutdown(ssl);
+ SSL_free(ssl);
+}
+