<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>198914</bug_id>
          
          <creation_ts>2007-11-12 11:34 0000</creation_ts>
          <short_desc>dev-libs/openssl-0.9.8g failure with SSLv3 handshakes when enable-tlsext</short_desc>
          <delta_ts>2008-05-29 13:50:26 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Ebuilds</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          <bug_file_loc>http://rt.openssl.org/Ticket/Display.html?id=1629</bug_file_loc>
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>224095</blocked>
          
          <everconfirmed>1</everconfirmed>
          <reporter>drear@iki.fi</reporter>
          <assigned_to>base-system@gentoo.org</assigned_to>
          <cc>anton.bugs@gmail.com</cc>
    
    <cc>caster@gentoo.org</cc>
    
    <cc>polynomial-c@gentoo.org</cc>
    
    <cc>ShadowMaster@Shadow-Realm.org</cc>

      

      
          <long_desc isprivate="0">
            <who>drear@iki.fi</who>
            <bug_when>2007-11-12 11:34:24 0000</bug_when>
            <thetext>Hi.

As openssl-0.9.8g went stable, I fail to fetch mail from one server via fetchmail:

1247:error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure:s3_pkt.c:1053:SSL alert number 40

Bear in mind that I know practically nothing about SSL/OpenSSL, but I can verify that everything works perfectly fine with dev-libs/openssl-0.9.8f.

* * *

zealot ~ # emerge --info --ignore-default-opts
Portage 2.1.3.19 (default-linux/amd64/2007.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.23-hardened-r1 x86_64)
=================================================================
System uname: 2.6.23-hardened-r1 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+
Timestamp of tree: Mon, 12 Nov 2007 03:46:01 +0000
app-shells/bash:     3.2_p17
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.4.4-r6
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.9-r2
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.6.3, 1.7.9-r1, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22-r2
ACCEPT_KEYWORDS=&quot;amd64&quot;
CBUILD=&quot;x86_64-pc-linux-gnu&quot;
CFLAGS=&quot;-march=athlon64 -msse3 -O2 -pipe&quot;
CHOST=&quot;x86_64-pc-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config&quot;
CONFIG_PROTECT_MASK=&quot;/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d /usr/kde/*/share/apps/kjava/kjava.policy /usr/kde/*/shutdown/agent-shutdown.sh /usr/kde/3.5/share/services/rlogin.protocol&quot;
CXXFLAGS=&quot;-march=athlon64 -msse3 -O2 -pipe&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
EMERGE_DEFAULT_OPTS=&quot;--ask --verbose&quot;
FEATURES=&quot;buildpkg collision-protect distlocks fixpackages metadata-transfer multilib-strict parallel-fetch sandbox sfperms suidctl unmerge-orphans userfetch userpviv usersandbox&quot;
GENTOO_MIRRORS=&quot;http://trumpetti.atm.tut.fi/gentoo http://mirror.uni-c.dk/pub/gentoo http://ds.thn.htu.se/linux/gentoo http://mirror.gentoo.no/ http://distfiles.gentoo.org&quot;
LANG=&quot;en_US.utf8&quot;
LC_ALL=&quot;en_US.utf8&quot;
LINGUAS=&quot;en en_GB en_US&quot;
MAKEOPTS=&quot;-j3&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_RSYNC_OPTS=&quot;--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
PORTDIR_OVERLAY=&quot;/usr/local/portage&quot;
SYNC=&quot;rsync://rsync.europe.gentoo.org/gentoo-portage&quot;
USE=&quot;3dnow 3dnowext X alsa amd64 berkdb bitmap-fonts bzip2 cli cracklib crypt cups curl dri fortran gdbm gif gpm iconv isdnlog jpeg kde kdehiddenvisibility midi mmx mmxext mudflap ncurses nls nptl nptlonly opengl openmp pam pcre perl png pppd python qt3 readline reflection session spell spl sse sse2 ssl tcl tcltk tcpd threads tiff tk truetype truetype-fonts type1-fonts unicode xcomposite xinerama xorg zlib&quot; ALSA_CARDS=&quot;emu10k1 intel8x0&quot; ALSA_PCM_PLUGINS=&quot;adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol&quot; ELIBC=&quot;glibc&quot; INPUT_DEVICES=&quot;keyboard mouse&quot; KERNEL=&quot;linux&quot; LINGUAS=&quot;en en_GB en_US&quot; USERLAND=&quot;GNU&quot; VIDEO_CARDS=&quot;nv&quot;
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>drear@iki.fi</who>
            <bug_when>2007-11-12 11:45:40 0000</bug_when>
            <thetext>I forgot to mention: all tests are passed with openssl-0.9.8g.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>polynomial-c@gentoo.org</who>
            <bug_when>2007-11-24 07:50:31 0000</bug_when>
            <thetext>Hi,

I have a similar problem with net-irc/xchat-2.8.4 and dev-libs/openssl-0.9.8g:

[08:46:06] --- Looking up irc.mozilla.org..
[08:46:06] --- Connecting to irc.mozilla.org (63.245.208.159) port 6697..
[08:46:07] --- Connection failed. Error: (336151568) error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure

This doesn&apos;t happen on all networks/servers but for irc.mozilla.org it&apos;s 100% reproduceable.
I don&apos;t know if this problem started after upgrade to openssl-0.9.8g or after upgrade to glibc-2.6.1...

Cheers
Poly-C</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>polynomial-c@gentoo.org</who>
            <bug_when>2007-11-24 07:54:04 0000</bug_when>
            <thetext>Created an attachment (id=136861)
emerge --info

P.S.: I know, I&apos;m using masked app-shells/bash-3.2_p25 but that&apos;s intentional (I already patched portage to work with this bash version) and this problem already occured with bash-3.2_p17...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ShadowMaster@Shadow-Realm.org</who>
            <bug_when>2007-11-29 00:01:09 0000</bug_when>
            <thetext>Confirming openssl-0.9.8g causing xchat amongst others to fail SSL handshakes.

emerge --info:
Portage 2.1.4_rc3 (default-linux/x86/2006.1, gcc-4.1.2, glibc-2.7-r0, 2.6.22-gentoo-r9 i686)
=================================================================
System uname: 2.6.22-gentoo-r9 i686 AMD Athlon(tm) XP 2400+
Timestamp of tree: Tue, 27 Nov 2007 23:00:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p17
dev-java/java-config: 1.3.7, 2.1.2-r1
dev-lang/python:     2.4.4-r4, 2.5.1-r4
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
dev-util/confcache:  0.4.2-r1
sys-apps/baselayout: 1.12.10-r5
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22-r2
ACCEPT_KEYWORDS=&quot;x86&quot;
CBUILD=&quot;i686-pc-linux-gnu&quot;
CFLAGS=&quot;-O2 -mtune=athlon -fomit-frame-pointer -march=athlon-xp -pipe&quot;
CHOST=&quot;i686-pc-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config&quot;
CONFIG_PROTECT_MASK=&quot;/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d&quot;
CXXFLAGS=&quot;-O2 -mtune=athlon -fomit-frame-pointer -march=athlon-xp -pipe&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
EMERGE_DEFAULT_OPTS=&quot;--with-bdeps y&quot;
FEATURES=&quot;ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch&quot;
GENTOO_MIRRORS=&quot;http://mirror.gentoo.no/ ftp://ftp.du.se/pub/os/gentoo http://ds.thn.htu.se/linux/gentoo http://gd.tuwien.ac.at/opsys/linux/gentoo/&quot;
MAKEOPTS=&quot;-j2&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_RSYNC_OPTS=&quot;--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
PORTDIR_OVERLAY=&quot;/usr/local/portage&quot;
SYNC=&quot;rsync://rsync.gentoo.org/gentoo-portage&quot;
USE=&quot;3dnow 3dnowext X aiglx async bcmath beagle berkdb bitmap-fonts bittorrent bootsplash bzip2 cairo ccache chroot clamav cli contentcache cpudetection cracklib crypt css cups curl dbus dri dvd emerald epiphany fbsplash ffmpeg finger firefox flac font-server fontconfig fortran ftp gaim gd gdbm glitz gmail gmailtimestamps gnome gnome-print gnutls gpm gstreamer gtalk gtk gtk2 hal iconv icq imap ipv6 isdnlog jabber java javascript jpeg kde lm_sensors logitech-mouse maildir matroska mbox midi mime mmap mmx mono mp3 mp4 mpeg mplayer mudflap ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pam_chroot pam_timestamp pango pcre pdf perl png ppds python qt3 qt4 readline reflection reiser4 reiserfs ruby samba session snmp spell spl sqlite3 sse sse-filters ssl stream subversion svg symlink tcpd theora threads tiff tk truetype-fonts type1-fonts unicode vcd vorbis wv x264 x86 xface xorg xv yahoo zlib&quot; ALSA_CARDS=&quot;ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci&quot; ALSA_PCM_PLUGINS=&quot;adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol&quot; ELIBC=&quot;glibc&quot; INPUT_DEVICES=&quot;keyboard mouse evdev&quot; KERNEL=&quot;linux&quot; LCD_DEVICES=&quot;bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text&quot; USERLAND=&quot;GNU&quot; VIDEO_CARDS=&quot;nvidia vesa&quot;
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>caster@gentoo.org</who>
            <bug_when>2007-12-14 11:03:17 0000</bug_when>
            <thetext>Not sure if it&apos;s exactly the same problem, but I cannot connect to google talk with net-im/sim and openssl-0.9.8g, and 0.9.8f works fine
There&apos;s a bug report that suggests that on debian, both versions work (so maybe they have some patch?):
http://developer.berlios.de/bugs/?func=detailbug&amp;bug_id=12510&amp;group_id=4482</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>brad@mainstreetsoftworks.com</who>
            <bug_when>2008-03-21 12:27:49 0000</bug_when>
            <thetext>just as an FYI, this is in OpenSSL&apos;s request tracker with a patch an explanation:
http://rt.openssl.org/index.html?q=1629</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2008-03-23 17:49:45 0000</bug_when>
            <thetext>we added enable-tlsext by default in 0.9.8g ... if you remove that from the ebuild, things should probably work</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>caster@gentoo.org</who>
            <bug_when>2008-03-24 12:51:08 0000</bug_when>
            <thetext>Right, disabling tlsext helped with my issue from comment 5. Making it a USE flag would make it easier, but your call, dunno how far is a fixed upstream version.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2008-03-24 13:54:47 0000</bug_when>
            <thetext>a USE flag would just ignore the issue ... and then people would just complain about the same thing when the flag was turned on ...

has anyone tried the upstream patch (user/pass = guest/guest) ?  we can either apply that or just drop tlsext until it&apos;s fixed ... it was only added on a lark anyways; nothing is needing it at the moment</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>caster@gentoo.org</who>
            <bug_when>2008-03-24 14:44:45 0000</bug_when>
            <thetext>(In reply to comment #9)
&gt; a USE flag would just ignore the issue ... and then people would just complain
&gt; about the same thing when the flag was turned on ...
&gt; 
&gt; has anyone tried the upstream patch (user/pass = guest/guest) ?

Not yet, I guessed it&apos;s not upstream patch but an user attached patch (please prove me wrong) and that no upstream dev commented on it yet.
(is your guest/guest also from bugmenot or something that&apos;s suggested on the page itself? couldn&apos;t even find a &quot;register&quot; link, not to mention the tracker is localised to czech in a fugly way and there&apos;s no english option :)

&gt; we can either
&gt; apply that or just drop tlsext until it&apos;s fixed ... it was only added on a lark
&gt; anyways; nothing is needing it at the moment
 
I can test and it will probably work, just questioning the upstream intention.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gtg655b@mail.gatech.edu</who>
            <bug_when>2008-03-24 14:51:18 0000</bug_when>
            <thetext>I have similar results: openssl-0.9.8g doesn&apos;t work on one particular e-mail server, but 0.9.8f works fine.

If someone cares to supply an ebuild with the potential patch, I&apos;ll happily test it and report whether the patch fixes it. But I would urge either patching this or removing the offending flag, especially seeing as it doesn&apos;t appear to be needed by anything.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2008-03-24 19:26:56 0000</bug_when>
            <thetext>the guest/guest part i read somewhere in the openssl docs ... dont ask me where; their site is a pita to find stuff :p

will people stop posting that &quot;downgrading to 0.9.8f fixes things&quot; ... we dont care about the version difference.  all that matters is removing of the tlsext flag in the 0.9.8g ebuild and things work after that.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>cardoe@gentoo.org</who>
            <bug_when>2008-03-25 00:25:38 0000</bug_when>
            <thetext>I feel the proper resolution here is going to be to merge the patch provided in OpenSSL&apos;s RT. Some servers can not handle TLS (which is technically SSLv3.1) Extensions (which are present in TLSv1.1/SSLv3.2) on SSLv3 connections. It&apos;s a simple version check and omission of the extensions.

If we&apos;ve got SSLv3.0, don&apos;t offer extensions since extension support wasn&apos;t formally in a spec until SSLv3.1. If we have at least SSLv3.1, offer extensions. It seems straight forward.

Additionally, based on Caster&apos;s bug link I reduced this down to a simple test case.

$ openssl s_client -ssl3 -no_ssl2 -showcerts -connect talk.google.com:5223

In doing so I tested the supplied patch in OpenSSL&apos;s RT. This also resolves several complains people have had with Pidgin and Google Talk.

Please use openssl-0.9.8g-r1</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>caster@gentoo.org</who>
            <bug_when>2008-03-25 11:03:10 0000</bug_when>
            <thetext>(In reply to comment #13)
&gt; $ openssl s_client -ssl3 -no_ssl2 -showcerts -connect talk.google.com:5223

I can confirm this test case now works in -r1, however:
 
&gt; In doing so I tested the supplied patch in OpenSSL&apos;s RT. This also resolves
&gt; several complains people have had with Pidgin and Google Talk.

Unfortunately SIM still doesn&apos;t work with Google Talk (but works without enable-tlsext in -r0). Either the patch is incomplete and the extensions are also used elsewhere, or SIM sets the connection in a way that doesn&apos;t trigger the if clauses? Unfortunately can&apos;t see from the intergrated network monitor if the error seems different than without patch.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>cardoe@gentoo.org</who>
            <bug_when>2008-03-25 14:18:22 0000</bug_when>
            <thetext>What port is SIM connecting to over at Google Talk? 5222 is the default Google Talk port which uses TLS. Where as 5223 appears to use SSLv3.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>cardoe@gentoo.org</who>
            <bug_when>2008-03-25 14:19:33 0000</bug_when>
            <thetext>This patch allowed be to be successful in connecting to Google Talk via both ports using Pidgin, while not using the patch only allowed me to connect via 5222.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>caster@gentoo.org</who>
            <bug_when>2008-03-29 19:26:01 0000</bug_when>
            <thetext>(In reply to comment #15)
&gt; What port is SIM connecting to over at Google Talk? 5222 is the default Google
&gt; Talk port which uses TLS. Where as 5223 appears to use SSLv3.

SIM uses 5223, I think it never worked with 5222, including now.

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>anton.bugs@gmail.com</who>
            <bug_when>2008-04-12 17:32:28 0000</bug_when>
            <thetext>(In reply to comment #14)

Thanks. The same sim problems and fix here.
The -r1 patch doesn&apos;t work fully.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>cardoe@gentoo.org</who>
            <bug_when>2008-04-14 04:04:12 0000</bug_when>
            <thetext>Still need code to re-produce or steps to reproduce this on my machine OTHER then installing/using sim.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>matthew4196@gmail.com</who>
            <bug_when>2008-04-20 23:54:10 0000</bug_when>
            <thetext>I&apos;ve had a look at the SIM code and it looks like it is using TLSv1_method in sim/sslclient.cpp to connect.  Patching it to use SSLv23_client_method allows it to work with the -r1 patch.

This can be tested with:

$ openssl s_client -tls1 -no_ssl2 -showcerts -connect talk.google.com:5223

which works without enable-tlsext but fails with enable-tlsext enabled even with  the -r1 patch.

This seems to be critical as openssl-0.9.8g has been marked as stable since November and is also installed in stage3-i686-2008.0_beta1.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>anton.bugs@gmail.com</who>
            <bug_when>2008-04-23 13:34:55 0000</bug_when>
            <thetext>Created an attachment (id=150701)
sim-0.9.4.3-sslv23.patch

Thanks Matthew, nice one. Everything is working fine now. I guess I&apos;ll need to file a separate bug report for it. And openssl -r1 should really go stable now.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>caster@gentoo.org</who>
            <bug_when>2008-04-23 13:53:14 0000</bug_when>
            <thetext>(In reply to comment #21)
&gt; Thanks Matthew, nice one. Everything is working fine now. I guess I&apos;ll need to
&gt; file a separate bug report for it. And openssl -r1 should really go stable now.
 
Um, the question is if sim is really doing something it shouldn&apos;t, and tlsext just revealed it, or if it&apos;s still a problem of openssl (or perhaps the gmail server) and the patch is just working around it?
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>cardoe@gentoo.org</who>
            <bug_when>2008-04-23 13:59:32 0000</bug_when>
            <thetext>(In reply to comment #22)
&gt; (In reply to comment #21)
&gt; &gt; Thanks Matthew, nice one. Everything is working fine now. I guess I&apos;ll need to
&gt; &gt; file a separate bug report for it. And openssl -r1 should really go stable now.
&gt; 
&gt; Um, the question is if sim is really doing something it shouldn&apos;t, and tlsext
&gt; just revealed it, or if it&apos;s still a problem of openssl (or perhaps the gmail
&gt; server) and the patch is just working around it?
&gt; 

SIM is connecting to a known SSL-only port with TLSv1 and relying on the fallback to SSLv3. I&apos;d say it&apos;s a broken assumption on SIM&apos;s part simply because if you advertised &quot;Connect to my SSL port&quot; and you ran SSLv2 (stupidly), then TLSv1_client_method would not work. As I previously explained, TLSv1 is really SSLv3.1, which is why TLSv1_client_method works when connecting to an SSLv3 server.... usually. However, TLS has a few things in it&apos;s spec that SSLv3 stuff doesn&apos;t expect and SSLv3 implementations don&apos;t have to follow the &quot;if you see something you don&apos;t know, ignore it&quot; that TLS follows (due to extensions).</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>anton.bugs@gmail.com</who>
            <bug_when>2008-04-23 14:45:51 0000</bug_when>
            <thetext>I know at least 1 more https server which require openssl -r1 so it&apos;s not gmail&apos;s problem and the openssl patch looks good.

The patch for sim is more a workaround for now. I think they should redesign ssl init sections and do something similar what stunnel does, stunnel-4.21/src/options.c:
    /* sslVersion */
    switch(cmd) {
    case CMD_INIT:
        section-&gt;client_method=SSLv3_client_method;
        break;
    case CMD_EXEC:
        if(strcasecmp(opt, &quot;sslVersion&quot;))
            break;
        if(!strcasecmp(arg, &quot;all&quot;)) {
            section-&gt;client_method=SSLv23_client_method;
        } else if(!strcasecmp(arg, &quot;SSLv2&quot;)) {
            section-&gt;client_method=SSLv2_client_method;
        } else if(!strcasecmp(arg, &quot;SSLv3&quot;)) {
            section-&gt;client_method=SSLv3_client_method;
        } else if(!strcasecmp(arg, &quot;TLSv1&quot;)) {
            section-&gt;client_method=TLSv1_client_method;
        } else
            return &quot;Incorrect version of SSL protocol&quot;;

but I&apos;m not an expert here, so it&apos;s just IMHO.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>johannes@truschnigg.info</who>
            <bug_when>2008-05-21 18:11:36 0000</bug_when>
            <thetext>I&apos;m apparently hitting the very same or a similar problem when trying to connect to cacert.org:

colo@zealot ~ $ openssl s_client -connect cacert.org:443 -no_ssl2 -bugs
CONNECTED(00000003)
[... snip ...]
verify return:1
1660:error:140943FC:SSL routines:SSL3_READ_BYTES:sslv3 alert bad record mac:s3_pkt.c:1053:SSL alert number 20
1660:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:188:
colo@zealot ~ $ openssl version
OpenSSL 0.9.8g 19 Oct 2007


~amd64:
* dev-libs/openssl [R 0.9.8g-r1] &lt;target&gt;
    Reasons: app-misc/ca-certificates-20070303-r1:0::installed
    -bindist -gmp -kerberos (sse2) -test zlib

CHOST=&quot;x86_64-pc-linux-gnu&quot;
CFLAGS=&quot;-O2 -pipe -march=nocona -fomit-frame-pointer&quot;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>cardoe@gentoo.org</who>
            <bug_when>2008-05-21 19:47:03 0000</bug_when>
            <thetext>(In reply to comment #25)
&gt; I&apos;m apparently hitting the very same or a similar problem when trying to
&gt; connect to cacert.org:

I believe you&apos;re having a different error since I&apos;m able to reproduce this on multiple versions of OpenSSL. 0.9.8e, 0.9.8f, 0.9.8g</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>cardoe@gentoo.org</who>
            <bug_when>2008-05-21 19:51:07 0000</bug_when>
            <thetext>(In reply to comment #25)
&gt; I&apos;m apparently hitting the very same or a similar problem when trying to
&gt; connect to cacert.org:
&gt; 
&gt; colo@zealot ~ $ openssl s_client -connect cacert.org:443 -no_ssl2 -bugs
&gt; CONNECTED(00000003)
&gt; [... snip ...]
&gt; verify return:1
&gt; 1660:error:140943FC:SSL routines:SSL3_READ_BYTES:sslv3 alert bad record
&gt; mac:s3_pkt.c:1053:SSL alert number 20
&gt; 1660:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake
&gt; failure:s23_lib.c:188:

However, additionally, you&apos;re connecting to an SSLv2/SSLv3 port with TLSv1/TLSv1.1, this is an improper way to connect and you should fix the code that spawned you to write this test case. </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>caster@gentoo.org</who>
            <bug_when>2008-05-29 11:03:14 0000</bug_when>
            <thetext>BTW the patch for sim was applied in svn and works fine here. But it&apos;s available only in sim-9999 live svn, so people can still hit the problem. I guess a separate bug for sim should be opened?
As for openssl itself, looks like upstream didn&apos;t apply the patch in 0.9.8h and we apply it ourselves.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>anton.bugs@gmail.com</who>
            <bug_when>2008-05-29 13:44:21 0000</bug_when>
            <thetext>I already suggested to split it in the comment #21, so here we go, bug #224095
You might want to close this bug now and/or investigate why the patch for openssl hasn&apos;t been included into the version 0.9.8h.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>cardoe@gentoo.org</who>
            <bug_when>2008-05-29 13:50:26 0000</bug_when>
            <thetext>(In reply to comment #29)
&gt; I already suggested to split it in the comment #21, so here we go, bug #224095
&gt; You might want to close this bug now and/or investigate why the patch for
&gt; openssl hasn&apos;t been included into the version 0.9.8h.
&gt; 

Because 0.9.8h wasn&apos;t a bug fix release, it was a security fix release.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>136861</attachid>
            <date>2007-11-24 07:54 0000</date>
            <desc>emerge --info</desc>
            <filename>emerge--info.txt</filename>
            <type>text/plain</type>
            <data encoding="base64">UG9ydGFnZSAyLjEuMy4xOSAoZGVmYXVsdC1saW51eC94ODYvMjAwNy4wL2Rlc2t0b3AsIGdjYy00
LjIuMiwgZ2xpYmMtMi42LjEtcjAsIDIuNi4yMi4xNCBpNjg2KQo9PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpTeXN0ZW0gdW5h
bWU6IDIuNi4yMi4xNCBpNjg2IEFNRCBBdGhsb24odG0pIFhQIDMwMDArClRpbWVzdGFtcCBvZiB0
cmVlOiBTYXQsIDI0IE5vdiAyMDA3IDA2OjQ2OjAxICswMDAwCmFwcC1zaGVsbHMvYmFzaDogICAg
IDMuMl9wMjUKZGV2LWphdmEvamF2YS1jb25maWc6IDEuMy43LCAyLjEuMi1yMQpkZXYtbGFuZy9w
eXRob246ICAgICAyLjUuMS1yNApzeXM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SJHTlUiIFZJREVPX0NBUkRTPSJudiBudmlk
aWEiClVuc2V0OiAgQ1BQRkxBR1MsIENUQVJHRVQsIElOU1RBTExfTUFTSywgTENfQUxMLCBNQUtF
T1BUUywgUE9SVEFHRV9DT01QUkVTUywgUE9SVEFHRV9DT01QUkVTU19GTEFHUywgUE9SVEFHRV9S
U1lOQ19FWFRSQV9PUFRTCgo=
</data>        

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>150701</attachid>
            <date>2008-04-23 13:34 0000</date>
            <desc>sim-0.9.4.3-sslv23.patch</desc>
            <filename>sim-0.9.4.3-sslv23.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIHNpbS9zc2xjbGllbnQuY3BwLm9yaWcJMjAwNi0wMi0wMSAwNDoyNDoyNS4wMDAwMDAwMDAg
KzA4MDAKKysrIHNpbS9zc2xjbGllbnQuY3BwCTIwMDgtMDQtMjMgMjA6NTk6NDcuMDAwMDAwMDAw
ICswODAwCkBAIC00MDYsNyArNDA2LDcgQEAKIAogYm9vbCBTU0xDbGllbnQ6OmluaXRUTFMxKGJv
b2wgYkRIKQogewotICAgIG1wQ1RYID0gU1NMX0NUWF9uZXcoVExTdjFfbWV0aG9kKCkpOworICAg
IG1wQ1RYID0gU1NMX0NUWF9uZXcoU1NMdjIzX2NsaWVudF9tZXRob2QoKSk7CiAgICAgaWYgKG1w
Q1RYID09IE5VTEwpCiAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICBpZiAoYkRIKXsK
</data>        

          </attachment>
    </bug>

</bugzilla>