diff -Nacr w3m.orig/configure w3m/configure
*** w3m.orig/configure	Thu Apr 20 23:37:24 2000
--- w3m/configure	Mon Jun 19 16:34:16 2000
***************
*** 187,192 ****
--- 187,193 ----
    echo "use_mouse=$use_mouse" >> config.param
    echo "use_cookie=$use_cookie" >> config.param
    echo "use_ssl=$use_ssl" >> config.param
+   echo "use_idea=$use_idea" >> config.param
    if [ -n "$dmodel" ]; then
      echo "dmodel=$dmodel" >> config.param
    fi
***************
*** 236,241 ****
--- 237,287 ----
    fi
  }
  
+ find_krb5() {
+   krb5include=""
+   def_krb5dir=""
+   for i1 in /usr/local /opt
+   do
+     for i2 in /krb5 
+     do
+       dirname=${i1}${i2}
+       if [ -f $dirname/include/krb5.h ]; then
+         krb5include="-I${dirname}/include"
+       fi
+       for i3 in lib
+       do
+         dirname=${i1}${i2}/${i3}
+         if [ -f $dirname/libkrb5.a ]; then
+ 		  def_krb5dir="${dirname}"
+ 		  krb5lib="-L${def_krb5dir}"
+ 		  for i4 in gssapi_krb5 krb5 com_err
+ 		  do
+ 			if [ -f $dirname/lib${i4}.a ]; then
+ 			  krb5lib="$krb5lib -l${i4}"
+ 			fi
+ 		  done
+           if [ -f $dirname/libcrypto.a ]; then
+ 			krb5lib="$krb5lib $dirname/libcrypto.a"
+ 		  fi
+         fi
+       done
+     done
+   done
+   if [ "$krb5include" = "" ]; then
+     echo "Where is krb5.h? (for example, /usr/local/krb5/include)"
+     Echo ":"
+     read ks_ans
+     krb5include="-I${ks_ans}"
+   fi
+   if [ "$def_krb5dir" = "" ]; then
+     echo "Where is libkrb5.a? (for example, /usr/local/krb5/lib)"
+     Echo ":"
+     read def_krb5dir
+     krb5lib="-L${def_krb5dir} -lgssapi_krb5 -lkrb5 -lcom_err"
+ 	krb5lib="$krb5lib ${def_krb5dir}/libcrypto.a"
+   fi
+ }
+ 
  #--------------------------------------------------------------
  if [ -n "$USER" ]; then
  	user=$USER
***************
*** 452,457 ****
--- 498,504 ----
      use_mouse=n; def_mouse="#undef MOUSE"
      use_cookie=n; def_cookie="#undef USE_COOKIE"
      use_ssl=n; def_ssl="#undef USE_SSL"
+     use_idea=n; def_idea="#define NO_IDEA"
      save_params
      customized=y
      ;;
***************
*** 461,466 ****
--- 508,514 ----
      use_mouse=n; def_mouse="#undef MOUSE"
      use_cookie=n; def_cookie="#undef USE_COOKIE"
      use_ssl=n; def_ssl="#undef USE_SSL"
+     use_idea=n; def_idea="#define NO_IDEA"
      save_params
      customized=y
      ;;
***************
*** 470,475 ****
--- 518,524 ----
      use_mouse=y; def_mouse="#define MOUSE"
      use_cookie=n; def_cookie="#undef USE_COOKIE"
      use_ssl=n; def_ssl="#undef USE_SSL"
+     use_idea=n; def_idea="#define NO_IDEA"
      save_params
      customized=y
      ;;
***************
*** 479,484 ****
--- 528,534 ----
      use_mouse=y; def_mouse="#define MOUSE"
      use_cookie=y; def_cookie="#define USE_COOKIE"
      use_ssl=n; def_ssl="#undef USE_SSL"
+     use_idea=n; def_idea="#define NO_IDEA"
      save_params
      customized=y
      ;;
***************
*** 488,494 ****
--- 538,546 ----
      use_mouse=y; def_mouse="#define MOUSE"
      use_cookie=y; def_cookie="#define USE_COOKIE"
      use_ssl=y; def_ssl="#define USE_SSL"
+     use_idea=n; def_idea="#define NO_IDEA"
      find_ssl
+     find_krb5
      save_params
      customized=y
      ;;
***************
*** 578,583 ****
--- 630,665 ----
    sslinclude=""
  fi
  
+ if [ "$use_ssl" = y ]; then
+ echo "Do you want to use IDEA with SSL?"
+ echo '(You need openSSL library; Please see http://www.openssl.org/)'
+ yesno use_idea "$use_idea" n
+ echo "use_idea=$use_idea" >> config.param
+ if [ "$use_idea" = y ]; then
+   def_idea="#undef NO_IDEA"
+ else
+   def_idea="#define NO_IDEA"
+   sslinclude="$sslinclude -DNO_IDEA"
+ fi
+ fi
+ 
+ if [ "$use_ssl" = y ]; then
+ echo "Do you want to use Kerberos with SSL?"
+ echo '(You need KRB5 library; Please see http://web.mit.edu/kerberos/www/)'
+ yesno use_krb5 "$use_krb5" y
+ echo "use_krb5=$use_krb5" >> config.param
+ if [ "$use_krb5" = y ]; then
+   find_krb5
+   def_krb5dir="$def_krb5dir"
+   krb5lib="$krb5lib"
+   krb5include="$krb5include"
+ else
+   def_krb5dir=""
+   krb5lib=""
+   krb5include=""
+ fi
+ fi
+ 
  fi
  
  if [ "$use_ssl" = y ]; then
***************
*** 751,757 ****
      searchlibs="socket nsl"
      ;;
    *)
!     searchlibs="bsd BSD 44bsd socket nsl"
      ;;
  esac
  for lib in $searchlibs
--- 833,839 ----
      searchlibs="socket nsl"
      ;;
    *)
!     searchlibs="bsd BSD 44bsd socket nsl resolv"
      ;;
  esac
  for lib in $searchlibs
***************
*** 1355,1364 ****
  HELP_DIR = $helpdir
  LIB_DIR = $suplibdir
  HELP_FILE = $helpfile
! SYS_LIBRARIES = $gpmlib $extlib $termlib $ssllib
  LOCAL_LIBRARIES = $ldflags
  CC = $cc
! MYCFLAGS = $cflags $bsdinclude $sslinclude
  KEYBIND_SRC = $keymap_file.c
  KEYBIND_OBJ = $keymap_file.o
  EXT=$extension
--- 1437,1446 ----
  HELP_DIR = $helpdir
  LIB_DIR = $suplibdir
  HELP_FILE = $helpfile
! SYS_LIBRARIES = $gpmlib $extlib $termlib $ssllib $krb5lib
  LOCAL_LIBRARIES = $ldflags
  CC = $cc
! MYCFLAGS = $cflags $bsdinclude $sslinclude $krb5include
  KEYBIND_SRC = $keymap_file.c
  KEYBIND_OBJ = $keymap_file.o
  EXT=$extension
***************
*** 1385,1390 ****
--- 1467,1473 ----
  $def_menu
  $def_cookie
  $def_ssl
+ $def_idea
  $def_use_ssl_verify
  $def_ftppass_hostnamegen
  $def_cmdline_config
diff -Nacr w3m.orig/url.c w3m/url.c
*** w3m.orig/url.c	Thu Apr 20 22:53:15 2000
--- w3m/url.c	Mon Jun 19 16:34:16 2000
***************
*** 168,174 ****
  }
  
  SSL            *
! openSSLHandle(int sock)
  {
      SSL            *handle;
  #ifdef USE_SSL_VERIFY
--- 168,174 ----
  }
  
  SSL            *
! openSSLHandle(int sock, char *host)
  {
      SSL            *handle;
  #ifdef USE_SSL_VERIFY
***************
*** 210,215 ****
--- 210,218 ----
      }
      handle = SSL_new(ssl_ctx);
      SSL_set_fd(handle, sock);
+ 	if (host && handle->kssl_ctx) {
+ 	    kssl_ctx_setstring(handle->kssl_ctx, KSSL_SERVER, host);
+ 	}
      if (SSL_connect(handle) <= 0)
  	return NULL;
      return handle;
***************
*** 1121,1127 ****
  #ifdef USE_SSL
  	    if (pu->scheme == SCM_HTTPS && *status == HTST_CONNECT) {
  		sock = ouf->stream.ss->sock;
! 		if (!(sslh = openSSLHandle(sock))) {
  		    *status = HTST_MISSING;
  		    return uf;
  		}
--- 1124,1130 ----
  #ifdef USE_SSL
  	    if (pu->scheme == SCM_HTTPS && *status == HTST_CONNECT) {
  		sock = ouf->stream.ss->sock;
! 		if (!(sslh = openSSLHandle(sock, pu->host))) {
  		    *status = HTST_MISSING;
  		    return uf;
  		}
***************
*** 1176,1182 ****
  	    }
  #ifdef USE_SSL
  	    if (pu->scheme == SCM_HTTPS) {
! 		if (!(sslh = openSSLHandle(sock))) {
  		    *status = HTST_MISSING;
  		    return uf;
  		}
--- 1179,1185 ----
  	    }
  #ifdef USE_SSL
  	    if (pu->scheme == SCM_HTTPS) {
! 		if (!(sslh = openSSLHandle(sock, pu->host))) {
  		    *status = HTST_MISSING;
  		    return uf;
  		}
