| 106 | |
| 107 | |
| 108 | class ProbabilisticStrategy(TlsStrategy): |
| 109 | def __init__(self, p: float): |
| 110 | self.p = p |
| 111 | super().__init__() |
| 112 | |
| 113 | def should_intercept(self, server_address: connection.Address) -> bool: |
| 114 | return random.uniform(0, 1) < self.p |
| 115 | |
| 116 | |
| 117 | class MaybeTls: |