### CI Link

https://gradle-enterprise.elastic.co/s/jze725jpxi7ki/console-log?task=:x-pack:plugin:security:internalClusterTest

### Repro line

./gradlew ':x-pack:plugin:security:internalClusterTest' --tests "org.elasticsearch.xpack.security.authc.pki.PkiAuthDelegationIntegTests.testDelegateThenAuthenticate" -Dtests.seed=F5EC1FEFFC2FC08B -Dtests.locale=en-GB -Dtests.timezone=SystemV/PST8PDT -Druntime.java=20

### Does it reproduce?

Yes

### Applicable branches

main

### Failure history

_No response_

### Failure excerpt

The pki integ test began failing today. Looking at the certs the test uses, they are all expired:

```
❯ openssl x509 -enddate -noout -in testClient.crt
notAfter=Jul 18 13:33:41 2023 GMT
❯ openssl x509 -enddate -noout -in testIntermediateCA.crt
notAfter=Jul 18 13:32:34 2023 GMT
❯ openssl x509 -enddate -noout -in testRootCA.crt
notAfter=Jul 18 13:32:20 2023 GMT
```
x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/pki/PkiAuthDelegationIntegTests.java
certificateChain = List.of(clientCertificate, intermediateCA, rootCA);
        }
        String delegateeUsername = randomFrom("user_all", "user_delegate_pki", "my_kibana_system");
        
        RequestOptions.Builder optionsBuilder = RequestOptions.DEFAULT.toBuilder();
        optionsBuilder.addHeader(
            "Authorization",
            basicAuthHeaderValue(delegateeUsername, SecuritySettingsSourceField.TEST_PASSWORD_SECURE_STRING)
        );
        var delegatePkiResponse = getSecurityClient(optionsBuilder.build()).delegatePkiAuthentication(certificateChain);
        String token = delegatePkiResponse.v1();
        assertThat(token, is(notNullValue()));
        assertNotNull(delegatePkiResponse.v2());
        final Map<String, Object> authentication = assertMap(delegatePkiResponse.v2(), AUTHENTICATION_FIELD);
        assertThat(authentication, hasEntry(Fields.USERNAME.getPreferredName(), "Elasticsearch Test Client"));
        
        optionsBuilder = RequestOptions.DEFAULT.toBuilder();
        optionsBuilder.addHeader("Authorization", "Bearer " + token);
        final TestSecurityClient securityClient = getSecurityClient(optionsBuilder.build());
        final Map<String, Object> authenticateResponse = securityClient.authenticate();
        assertThat(authenticateResponse, hasEntry(Fields.USERNAME.getPreferredName(), "Elasticsearch Test Client"));
        final Map<String, Object> metadata = assertMap(authenticateResponse, Fields.METADATA);
        assertThat(metadata, hasEntry("pki_dn", "O=org, OU=Elasticsearch, CN=Elasticsearch Test Client"));
        assertThat(metadata, hasEntry("pki_delegated_by_user", delegateeUsername));
        assertThat(metadata, hasEntry("pki_delegated_by_realm", "file"));
        
        List<?> roles = assertList(authenticateResponse, Fields.ROLES);
        assertThat(roles, empty());
        Map<String, Object> realm = assertMap(authenticateResponse, Fields.AUTHENTICATION_REALM);
        assertThat(realm, hasEntry(Fields.REALM_NAME.getPreferredName(), "pki3"));