AnsweredAssumed Answered

Get SSL details thorugh portalpy

Question asked by Adityakumar529 on Dec 14, 2016
Latest reply on Dec 29, 2016 by rastrauch

Hi team,

  I am working on I am trying to get the details of SSL certficates which the portal is using. 

 I have tried with some code but nothing is working. Any suggestion on this will be helpful.


import sys
import portalpy    
import csv  
import ssl, socket 
portalUrl           = ""
portalAdminUser     = "xxxx"
portalAdminPassword = "xxxx"       
portal = portalpy.Portal(portalUrl, portalAdminUser,portalAdminPassword)    
users = portal.search_users('(role:account_admin OR role:account_publisher  OR role:account_user)')  
activeUser = portal.logged_in_user()     
print activeUser['email']    
ctx = ssl.create_default_context()     
s = ctx.wrap_socket(socket.socket(),server_hostname='')    
s.connect((portal, 443))    
cert = s.getpeercert()     
print cert



Aditya Kumar