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 8061473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:21:03+00:00 2026-06-05T10:21:03+00:00

i am designing an ssl server where i am using twisted for it with

  • 0

i am designing an ssl server where i am using twisted for it with ssl and it requires client certificate authentication to continue to the program , when i verify the ssl certificate of the client it returns True but i want to pass the commanname and emailaddress in the client certificate so that i can get settings for that specific client in the handler class, so can you help me ?

from OpenSSL import SSL
from twisted.internet import ssl, reactor
from twisted.internet.protocol import Factory, Protocol
from twisted.web import server, resource, static, twcgi

class Handler(Protocol):
    def dataReceived(self, data):
        self.transport.write(data)

    def connectionMade(self):
        self.transport.write('hello world')

def verifyCallback(connection, x509, errnum, errdepth, ok):
    global client_username
    if not ok:
        return False
    else:           
        return True

if __name__ == '__main__':

    #setting up ssl json server
    factory = Factory()
    factory.protocol = Handler
    myContextFactory = ssl.DefaultOpenSSLContextFactory('server.key', 'server.crt',SSL.TLSv1_METHOD)
    ctx = myContextFactory.getContext()
    ctx.load_verify_locations("ca.crt")
    ctx.set_verify(SSL.VERIFY_PEER | SSL.VERIFY_FAIL_IF_NO_PEER_CERT,verifyCallback)
    reactor.listenSSL(8080, factory,myContextFactory)
    reactor.run()
  • 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-05T10:21:05+00:00Added an answer on June 5, 2026 at 10:21 am

    Call transport.getPeerCertificate in Protocol.dataReceived or another protocol method (only after you have received some data).

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

Sidebar

Related Questions

I'm in the designing stages of a custom tcp/ip protocol for mobile client-server communication.
When designing a client/server architecture, is there any advantage to multiplexing multiple connections from
We have a client/server system where all communications are done using a native protocol
Designing forms has always been fun, but getting them to send email on the
I designing an programming a website using Symfony2. I completed some parts and checked
I am designing a new CMS but want to design it to fit all
I am designing a file syncing application (like DropBox). The client keeps a persistent
When designing an rdlc report using the VS 2010 report designer, report items such
Im designing a dialerPad form using Windows form, there is a textbox which should
Designing a new system from scratch. I'll be using the STL to store lists

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.