473,888 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

unknown protocol error when connecting to an server via ssl


Hi *,

I have just started to learn python and I am having a problem with
an python client connecting to a perl server using ssl (I tried this
with pyOpenSSL and with the build in SSL Module).

I don't want to check a cerificate, so i simply tried a

from OpenSSL import SSL

s = socket.socket(s ocket.AF_INET, socket.SOCK_STR EAM)
s.connect(("127 .0.0.1", 2000)

s.sendall("100 Hello\n")

ctx = SSL.Context(SSL .SSLv23_METHOD)
ctx.set_verify( SSL_VERIFY_NONE ,self.verify_cb )
ss = SSL.Connection( ctx,s)
ss.set_connect_ state()

ss.sendall("101 User\n")

when writeing the 101 I'll get an SSL23_GET_SERVE R_HELLO
unknown protocol error. If I don't do the ssl stuff, everything
works.

I also tried this with the socket.ssl(s,No ne, None) to get a secure
socket - but I got the same error.

The server is not written by me - so I can't change that to python.
The problem is, that there is first an unencrypted socket, that is
converted to a secure socket.

the perl (server) code is something like this:

# creating a socket
$socket = IO::Socket::INE T->new(Listen => 5,
LocalPort => 2000,
Timeout => 15,
Resue => 1,
Proto => 'tcp');

# some more code

# accepting a remote connection
$session = $socket->accept;

# some more code

# convert the Socket to an ssl socket
$sslsocket = IO::Socket::SSL ::socket_to_SSL ($session,
SSL_verify_mode => 0x00)

# some more code

Does anybody know, where the UNKNOWN PROTOCOL error
comes from? I have changed the connection Mode to
SSLv2_METHOD but this gave me an GET_SERVER_HELL O
read wrong packet type error.

I have done this with python 2.3.4 under linux - and the perl stuff
is done via the IO-Socket-SSL package.

Thx,

Chris

Jul 18 '05 #1
0 2691

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2943
by: Robert | last post by:
did you solve this problem? It seems to be still present here with py2.3.5. Robert -- From: Manish Jethani <manish.j@gmx.net> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en
0
2083
by: Benjamin Schollnick | last post by:
Folks, With Windows XP, and Python v2.41 I am running into a problem.... The following code gives me an unknown protocol error.... And I am not sure how to resolve it... I have a API written for DocuShare for a non-SSL server, and I wanted to update it
1
6698
by: Fahad | last post by:
I am trying to send an e-mail using CDO I get this message when trying to send an e-mail. I am using the object Set ObjMsg = Server.CreateObject("CDO.Message") CDO.Message.1 (0x800C000D) The specified protocol is unknown. web server information
4
662
by: David Moore | last post by:
Hello I am using the System.DirectoryServices namespace classes to access Active Directory. We connect using the LDAP://DOMAIN method. The code works on local dev boxes, and in staging, but doesn't work on a particular box in our production environment. When we try to connect and do a search, we get a "The authentication mechanism is unknown" error. I have searched on Google, Microsoft Support Knowledge Base and Yahoo etc, and found this...
0
9033
by: David Moore | last post by:
Hello I posted a thread about this a while back, but I can't actually find it again so I can reply to it with the solution I found, so I'm making a new thread and hoping it goes to the top of the Google search results for the error like the previous thread. This is actually a solution to a problem, not a call for help, so you can stop reading now unless you're actually interested in the solution :)
1
8618
by: Robert | last post by:
On some connections only from some computers/network setups I get this error: Traceback (most recent call last): File "<interactive input>", line 1, in ? File "ClientCookie\_urllib2_support.pyo", line 524, in open File "ClientCookie\_urllib2_support.pyo", line 424, in http_response File "ClientCookie\_urllib2_support.pyo", line 541, in error File "urllib2.pyo", line 306, in _call_chain File "ClientCookie\_urllib2_support.pyo", line...
12
2809
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed both the iis and sql server in a single machine. Not too long ago, the machine had some hardware problems, and management has decided to purchase new servers, for both asp.net and sql server.
0
286
by: Greg | last post by:
My app makes a call to a remote server (about which I know relatively little) using Webclient.UploadData. This is done once every 51/2 mins and is called by code within a worker thread. 95% of the time this works ok and I get a sane response from the server. However, every night within the same broad time window of 7 hours, I get a relatively high incidence of WebException's being thrown. The status of this is "UnknownError". When I try to...
0
2013
by: aboutjav.com | last post by:
Hi, I need some help. I am getting this error after I complete the asp.net register control and click on the continue button. It crashed when it tries to get it calls this Profile property ((string)(this.GetPropertyValue("Address1")));
0
9961
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9800
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11185
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10778
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10439
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9597
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7990
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6014
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3252
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.