(&self, value: PyRef<PySslContext>, vm: &VirtualMachine)
| 2509 | } |
| 2510 | #[pygetset(setter)] |
| 2511 | fn set_context(&self, value: PyRef<PySslContext>, vm: &VirtualMachine) -> PyResult<()> { |
| 2512 | // Get SSL pointer - use thread-local during handshake to avoid deadlock |
| 2513 | // (connection lock is already held during handshake) |
| 2514 | let ssl_ptr = get_ssl_ptr_for_context_change(&self.connection); |
| 2515 | |
| 2516 | // Set the new SSL_CTX on the SSL object |
| 2517 | unsafe { |
| 2518 | let result = SSL_set_SSL_CTX(ssl_ptr, value.ctx().as_ptr()); |
| 2519 | if result.is_null() { |
| 2520 | return Err(vm.new_runtime_error("Failed to set SSL context")); |
| 2521 | } |
| 2522 | } |
| 2523 | |
| 2524 | // Update self.ctx to the new context |
| 2525 | *self.ctx.write() = value; |
| 2526 | Ok(()) |
| 2527 | } |
| 2528 | #[pygetset] |
| 2529 | fn server_hostname(&self) -> Option<PyStrRef> { |
| 2530 | self.server_hostname.clone() |
nothing calls this directly
no test coverage detected