Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7956249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:56:11+00:00 2026-06-04T03:56:11+00:00

I have the following simple python code, which is intended to perform an ssl

  • 0

I have the following simple python code, which is intended to perform an ssl handshake and validate certificates between a client and server:

ssl_test.py:

import ssl
import socket

s = socket.socket()
print "connecting..."
#logging.debug("Connecting")
# Connect with SSL mutual authentication
# We only trust our server's CA, and it only trusts user certificates signed by it
c = ssl.wrap_socket(s, cert_reqs=ssl.CERT_REQUIRED,
                    ssl_version=ssl.PROTOCOL_SSLv3, ca_certs='ca.crt',
                    certfile='user.crt', keyfile='user.key')
c.connect((constants.server_addr, constants.port))

When I execute this, I get the following error.

>python ssl_test.py
Traceback (most recent call last):
  File "ssl_test.py", line 12, in <module>
    c.connect(('192.168.1.82', 7070))
  File "C:\Python27\lib\ssl.py", line 331, in connect
    self._real_connect(addr, False)
  File "C:\Python27\lib\ssl.py", line 314, in _real_connect
    self.ca_certs, self.ciphers)
ssl.SSLError: [Errno 0] _ssl.c:340: error:00000000:lib(0):func(0):reason(0)

What does this error mean, and how do I resolve it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T03:56:13+00:00Added an answer on June 4, 2026 at 3:56 am

    This looks like http://bugs.python.org/issue2687, where the following answer is given:

    No, the problem is with your “ca_certs” argument on the client side.
    You can’t use a directory. You must use a file containing a number of
    concatenated certificates. I’ll beef up the documentation to make that
    clearer.

    I see that your ca_certs is a file, not a directory, but perhaps this still sheds some light. Is the ca.crt file validly formatted and in the right place?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following simple python test script that uses Suds to call a
I have the following simple methods for writing a python object to a file
I have the following simple Javascript code that allows only digits to be entered
We have the following simple Stored Procedure that runs as an overnight SQL server
I am writing a simple python code for a very task which some of
I have the following Python code: import xml.dom.minidom import xml.parsers.expat try: domTree = ml.dom.minidom.parse(myXMLFileName)
I am a very newbie in Python I have the following code: from SOAPpy
So, I have a GWT client, which interacts with a Python Google App Engine
I have following simple class: @interface Article: NSObject { NSString *title; } @property (copy,
I have following simple program: import std.stdio; int main(string[] argv) { writeln(Hello, world!); return

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.