首页 \ 问答 \ 混合SSL证书(Mix SSL certificates)

混合SSL证书(Mix SSL certificates)

我想为从域B加载图像的domainA获得SSL证书(我从另一个无cookie域加载它们以提高页面速度)。 我知道来自domainB的所有元素都应该通过SSL,但是我需要使用来自同一提供者的证书来保护第二个域吗? 我的意思是,我可以混合一个网页与一个ie verisign证书与图像来自另一个域名与另一个不同的 - 更便宜的证书SSL?


I'd like to have a SSL certificate for domainA that load images from domainB (I load them from another cookieless domain to improve page speed). I know that all elements coming from domainB should be over SSL, but do i need to secure this second domain with a certificate coming from the same provider? I mean, could I mix a page with a ie verisign certificate with images coming over SSL from another domain with a different - and cheaper - certificate?


原文:https://stackoverflow.com/questions/6408125
更新时间:2022-08-22 08:08

最满意答案

你正在寻找classmethod ,而不是staticmethod 。 如果使用@classmethod修饰方法,它将隐式接收该类作为第一个参数。

另请参阅相关问题@classmethod和@staticmethod对初学者的意义?


You are looking for classmethod, not staticmethod. If you decorate a method with @classmethod, it will implicitly receive the class as first parameter.

See also the related question Meaning of @classmethod and @staticmethod for beginner?

相关问答

更多
  • 你想用这种staticmethod实现什么? 如果你不知道它是什么,你如何期待它解决你的问题? 或者你只是在玩耍,看看staticmethod做什么? 在这种情况下, 阅读文档可能会更有成效,而不是随意应用它,并试图从行为中猜测它的功能。 无论如何,将@staticmethod应用到类中的函数定义中会产生一个“静态方法”。 不幸的是,“静态”是编程中最容易混淆的重载术语之一; 这意味着该方法不依赖于或改变对象的状态 。 如果我在类Bar定义了一个静态方法foo ,那么调用bar.foo(...) (其中ba ...
  • 在玩了一会儿之后,我找到了一个比SO中的其他方法更好的解决方案。 也许这对某人有帮助。 基本上这个想法如下: 检测类或静态方法的成员 获取包含在这些方法中的函数对象 将装饰器应用于此功能 将装饰函数包装在classmethod或staticmethod实例中 再次将它存储在课堂上 代码如下所示: def class_decorator(cls): for name, member in vars(cls).items(): # Good old function object, ju ...
  • 你正在寻找classmethod ,而不是staticmethod 。 如果使用@classmethod修饰方法,它将隐式接收该类作为第一个参数。 另请参阅相关问题@classmethod和@staticmethod对初学者的意义? You are looking for classmethod, not staticmethod. If you decorate a method with @classmethod, it will implicitly receive the class as firs ...
  • 给你几点想法: 静态方法的操作与类装饰器的运算符完全正交。 将函数变为静态方法仅影响在属性查找过程中发生的情况。 类装饰器是对类的编译时转换。 functools.wraps中没有“bug”。 它所做的就是将函数属性从一个函数复制到另一个函数。 正如目前所写,您的记忆工具不会考虑类方法和静态方法的不同调用签名。 这是在记忆中的一个弱点,而不是在课堂工具本身。 我认为你已经想像了类装饰器,静态方法,类方法和functools等工具具有某种相互整合的智能。 相反,所有这些工具都非常简单,需要程序员有意识地设计他 ...
  • 如果实例化类需要很长时间,并且多个测试可以使用相同的实例,那么可以使用setUpClass import unittest class MyTests(unittest.TestCase): @classmethod def setUpClass(cls): cls.obj = MyClass() def test_stuff(self): self.assertEqual(self.obj.thing, 10) If instantiating ...
  • 欢迎光临;-) 它看起来像你的意思是__getitem__(self, key) 。 和__setitem__(self, key, value) 。 尝试: class my_class(object): def __getitem__(self, key): return some_value_based_upon(key) #You decide the implementation here! def __setitem__(self, key, value): ...
  • 只需访问属性: class BodyMassIndex(object): #Inheriting from object in 2.x ensures a new-style class. count = 0 def __init__(self, name, weight, height): self.name = name self.weight = 14 * weight self.height = 12 * height self.notes = None ...
  • 我不知道如何使用元类来完成此操作,但这是使用mixin类的可能解决方案。 你可以使用这样的东西。 from inspect import signature from functools import partialmethod, partial class Naked: @staticmethod def echo1(foo): return f"echo1: {foo}" @staticmethod def echo2 ...
  • 发布后我发现了正确的答案 - 前向引用可以定义为字符串。 因此,正确答案相当简单,并且PyCharm会获得奖励: @staticmethod def from_other_datastructure(json_data: str) -> 'MyThing': return MyThing( [int(d) for d in json_data.split(',')] ) https://www.python.org/dev/peps/pep-0484/#forward-re ...
  • 我会尝试解释它是如何工作的。 首先,这是运行: a_game = Game("central_corridor") 这称为Game.__init__("central_corridor") 。 在__init__方法中, self.start取值“central_corridor”。 然后我们回到主体。 到目前为止,我们有一个名为a_game的变量。 这个变量实际上是Game类的一个实例,它有一些属性,比如a_game.start , a_game.quips , a_game.death()等。 接下来 ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。