Add support for https:// streams with OpenSSL.

Index: configure
===================================================================
--- configure	(revision 37696)
+++ configure	(working copy)
@@ -385,6 +385,7 @@
   --disable-ass          disable SSA/ASS subtitle support [autodetect]
   --enable-rpath         enable runtime linker path for extra libs [disabled]
   --disable-gnutls       disable GnuTLS [autodetect]
+  --disable-openssl      disable OpenSSL [autodetect]
 
 Codecs:
   --enable-gif              enable GIF support [autodetect]
@@ -848,6 +849,7 @@
 _sctp=auto
 _gethostbyname2=auto
 _gnutls=auto
+_openssl=auto
 _ftp=auto
 _musepack=no
 _vstream=auto
@@ -1345,6 +1347,8 @@
   --disable-rpath)      _rpath=no       ;;
   --enable-gnutls)       _gnutls=yes    ;;
   --disable-gnutls)      _gnutls=no     ;;
+  --enable-openssl)      _openssl=yes   ;;
+  --disable-openssl)     _openssl=no    ;;
 
   --enable-fribidi)     _fribidi=yes    ;;
   --disable-fribidi)    _fribidi=no     ;;
@@ -4399,6 +4403,24 @@
 fi
 echores "$_gnutls"
 
+echocheck "OpenSSL"
+if test "$_openssl" = auto && test "$_gnutls" != yes; then # only link one SSL lib
+  _openssl=no
+  if $_pkg_config --exists openssl ; then
+	  statement_check openssl/ssl.h 'SSL_new(NULL)' $($_pkg_config --libs --cflags openssl) &&
+      _openssl=yes
+  fi
+fi
+if test "$_openssl" = yes ; then
+  def_openssl='#define CONFIG_OPENSSL 1'
+  libavprotocols="$libavprotocols HTTPS_PROTOCOL TLS_PROTOCOL TLS_OPENSSL_PROTOCOL"
+  extra_cflags="$extra_cflags $($_pkg_config --cflags openssl)"
+  extra_ldflags="$extra_ldflags $($_pkg_config --libs openssl)"
+else
+  def_openssl='#define CONFIG_OPENSSL 0'
+fi
+echores "$_openssl"
+
 echocheck "Samba support (libsmbclient)"
 if test "$_smb" = yes; then
   extra_ldflags="$extra_ldflags -lsmbclient"
@@ -8685,6 +8707,7 @@
 CONFIG_CRYSTALHD= $crystalhd
 CONFIG_ENCODERS = yes
 CONFIG_GNUTLS   = $_gnutls
+CONFIG_OPENSSL  = $_openssl
 CONFIG_GPL      = yes
 CONFIG_ICONV    = $_iconv
 CONFIG_MLIB     = $_mlib
@@ -9230,12 +9253,12 @@
 #define CONFIG_FFSERVER 0
 #define CONFIG_FTRAPV 0
 $def_gnutls
+$def_openssl
 #define CONFIG_GPL 1
 #define CONFIG_GRAY 0
 #define CONFIG_LIBMODPLUG 0
 #define CONFIG_LIBVORBIS 0
 #define CONFIG_MEMORY_POISONING 0
-#define CONFIG_OPENSSL 0
 #define CONFIG_POWERPC_PERF 0
 /* For now prefer speed over avoiding potential invalid reads */
 #define CONFIG_SAFE_BITSTREAM_READER 0
