#NEWLINE# def getpeercert( self , binary_form = False ) : #NEWLINE# #INDENT# x509 = self . connection . get_peer_certificate ( ) #NEWLINE# if ( not x509 ) : #NEWLINE# #INDENT# return x509 #NEWLINE# #UNINDENT# if binary_form : #NEWLINE# #INDENT# return OpenSSL . crypto . dump_certificate ( OpenSSL . crypto . FILETYPE_ASN1 , x509 ) #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# 'subject' : ( ( ( 'commonName' , x509 . get_subject ( ) . CN ) , ) , ) , #NEWLINE# 'subjectAltName' : [ ( 'DNS' , value ) for value in get_subj_alt_name ( x509 ) ] , #NEWLINE# #UNINDENT# }