| 1502 | |
| 1503 | #[pymethod] |
| 1504 | fn set_ciphers(&self, ciphers: PyUtf8StrRef, vm: &VirtualMachine) -> PyResult<()> { |
| 1505 | let cipher_str = ciphers.as_str(); |
| 1506 | |
| 1507 | // Parse cipher string and store selected ciphers |
| 1508 | let selected_ciphers = parse_cipher_string(cipher_str).map_err(|e| { |
| 1509 | vm.new_os_subtype_error(PySSLError::class(&vm.ctx).to_owned(), None, e) |
| 1510 | .upcast() |
| 1511 | })?; |
| 1512 | |
| 1513 | // Store in context |
| 1514 | *self.selected_ciphers.write() = Some(selected_ciphers); |
| 1515 | |
| 1516 | Ok(()) |
| 1517 | } |
| 1518 | |
| 1519 | #[pymethod] |
| 1520 | fn get_ciphers(&self, vm: &VirtualMachine) -> PyResult<PyListRef> { |