(*, rotate_keys=False)
| 251 | |
| 252 | |
| 253 | def main(*, rotate_keys=False): |
| 254 | def existing_key(path): |
| 255 | if rotate_keys: |
| 256 | return None |
| 257 | return _load_key(path) |
| 258 | |
| 259 | ca = new_ca( |
| 260 | "ca", |
| 261 | private_key=existing_key("ca.key.pem"), |
| 262 | country_name="CA", |
| 263 | state_or_province_name="Ontario", |
| 264 | locality_name="Toronto", |
| 265 | organization_name="MagicStack Inc.", |
| 266 | organizational_unit_name="asyncpg tests", |
| 267 | common_name="asyncpg test root ca", |
| 268 | email_address="hello@magic.io", |
| 269 | ) |
| 270 | server = new_cert( |
| 271 | "server", |
| 272 | ca, |
| 273 | private_key=existing_key("server.key.pem"), |
| 274 | country_name="CA", |
| 275 | state_or_province_name="Ontario", |
| 276 | organization_name="MagicStack Inc.", |
| 277 | organizational_unit_name="asyncpg tests", |
| 278 | common_name="localhost", |
| 279 | email_address="hello@magic.io", |
| 280 | serial_number=4096, |
| 281 | ) |
| 282 | new_crl('server', ca, server) |
| 283 | |
| 284 | client_ca = new_ca( |
| 285 | "client_ca", |
| 286 | private_key=existing_key("client_ca.key.pem"), |
| 287 | country_name="CA", |
| 288 | state_or_province_name="Ontario", |
| 289 | locality_name="Toronto", |
| 290 | organization_name="MagicStack Inc.", |
| 291 | organizational_unit_name="asyncpg tests", |
| 292 | common_name="asyncpg test client CA", |
| 293 | email_address="hello@magic.io", |
| 294 | ) |
| 295 | client_subject = dict( |
| 296 | country_name="CA", |
| 297 | state_or_province_name="Ontario", |
| 298 | locality_name="Toronto", |
| 299 | organization_name="MagicStack Inc.", |
| 300 | organizational_unit_name="asyncpg tests", |
| 301 | common_name="ssl_user", |
| 302 | email_address="hello@magic.io", |
| 303 | ) |
| 304 | client = new_cert( |
| 305 | "client", |
| 306 | client_ca, |
| 307 | is_client=True, |
| 308 | private_key=existing_key("client.key.pem"), |
| 309 | **client_subject, |
| 310 | ) |
no test coverage detected