--with-ssl=openssl does not work

Before I found "--with-openssl", which works for me, I tried the also documented "--with-ssl=openssl". However, this tries to link against "-lopenssl", but the it should use "-lssl" instead.

Even with --with-openssl, this produces weird configure output:

checking for gnutls... no                                               
checking for library containing gnutls_global_init... no                
configure: WARNING: *** GNUTLS was not found. Fallback to libnettle for hashing and checksumming.                                                
checking for openssl... no                                              
checking for library containing SSL_CTX_new... no                       
configure: WARNING: *** OpenSSL was not found.                          
checking for openssl/ssl.h... yes                                       
checking for openssl/x509_vfy.h... yes                                  
checking for openssl/ocsp.h... yes                                                                                                               
checking for SSL_new... no                                                                                                                       
checking for X509_STORE_add_lookup... no                                
checking for library containing EVP_MD_CTX_new... -lcrypto                                                                                       

but despite this WARNING, later it says:

  SSL/TLS support:    openssl