当前位置: 首页>>代码示例>>Python>>正文


Python Server.subject方法代码示例

本文整理汇总了Python中Server.Server.subject方法的典型用法代码示例。如果您正苦于以下问题:Python Server.subject方法的具体用法?Python Server.subject怎么用?Python Server.subject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Server的用法示例。


在下文中一共展示了Server.subject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: connect_to_server

# 需要导入模块: from Server import Server [as 别名]
# 或者: from Server.Server import subject [as 别名]
    def connect_to_server(self, hostname, port):
        """Handle connection to desired server

        Handles checking of certificate.

        Return Server instance."""

        self.logger.info("Connecting to %s:%s" % (hostname, port))
        try:
            server = Server(hostname, port)
        except Exception as e:
            self.logger.error("Error connecting to %s:%s: %s" % (hostname, port, e))
            raise
        self.logger.debug("Server subject is %s" % server.subject().as_text())

        self.logger.info("Checking certificate with Perspectives")
        try:
            fingerprint = server.get_fingerprint()
            service = Service(hostname, port)
            self.checker.check_seen_fingerprint(service, fingerprint)
        except PerspectivesException as e:
            self.logger.error("Perspectives check failed: %s" % str(e))
            raise

        self.logger.debug("Connection to server established")
        return server
开发者ID:danwent,项目名称:PerProxy,代码行数:28,代码来源:PerProxy.py

示例2: connect_to_server

# 需要导入模块: from Server import Server [as 别名]
# 或者: from Server.Server import subject [as 别名]
    def connect_to_server(self, hostname, port):
        """Handle connection to desired server

        Handles checking of certificate.

        Return Server instance."""
        
        self.logger.info("Connecting to %s:%s" % (hostname, port))
        try:
            server = Server(hostname, port)
        except Exception as e:
            self.logger.error("Error connecting to %s:%s: %s" % (hostname,
                                                                     port,
                                                                     e))
            raise

        self.logger.debug("Server subject is %s" % (server.subject().as_text()))                             
        self.check_server(server)
        
        self.logger.debug("Connection to server established")
        return server
开发者ID:colabambino,项目名称:PerProxy,代码行数:23,代码来源:ProxyServer.py


注:本文中的Server.Server.subject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。