asciidoctor / asciidoctor-confluence

Push Asciidoctor file to Confluence
https://rubygems.org/gems/asciidoctor-confluence
MIT License
82 stars 28 forks source link

Authenticate with client certificate #33

Closed cforce closed 1 year ago

cforce commented 1 year ago

We need to use client certificate to call the api (mtls),. How can i configure a truststore and password for it and then a client certificate name which shall be used from there?

Exception in thread "main" org.sahli.asciidoc.confluence.publisher.client.http.RequestFailedException: request failed (request: GET https://domain.com/confluence/rest/api/content/890284430/child/page?limit=25&start=0&expand=version <empty body>, response: <none>, reason: Received fatal alert: handshake_failure)
    at org.sahli.asciidoc.confluence.publisher.client.http.ConfluenceRestClient.sendRequest(ConfluenceRestClient.java:247)
    at org.sahli.asciidoc.confluence.publisher.client.http.ConfluenceRestClient.sendRequestAndFailIfNot20x(ConfluenceRestClient.java:227)
    at org.sahli.asciidoc.confluence.publisher.client.http.ConfluenceRestClient.getNextChildPages(ConfluenceRestClient.java:[29](https://gitlab.com/Mercedes-Intelligent-Cloud/cloud-technologies-architecture/mbos-portal/-/jobs/3372970952#L29)1)
    at org.sahli.asciidoc.confluence.publisher.client.http.ConfluenceRestClient.getChildPages(ConfluenceRestClient.java:259)
    at org.sahli.asciidoc.confluence.publisher.client.ConfluencePublisher.deleteConfluencePagesNotPresentUnderAncestor(ConfluencePublisher.java:141)
    at org.sahli.asciidoc.confluence.publisher.client.ConfluencePublisher.startPublishingUnderAncestorId(ConfluencePublisher.java:126)
    at org.sahli.asciidoc.confluence.publisher.client.ConfluencePublisher.publish(ConfluencePublisher.java:81)
    at org.sahli.asciidoc.confluence.publisher.cli.AsciidocConfluencePublisherCommandLineClient.main(AsciidocConfluencePublisherCommandLineClient.java:98)
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
    at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2020)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1127)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1[36](https://gitlab.com/group/project/-/jobs/3372970952#L36)7)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1[37](https://gitlab.com/group/project/-/jobs/3372970952#L37)9)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:436)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:[38](https://gitlab.com/group/project/-/jobs/3372970952#L38)4)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:[39](https://gitlab.com/group/project/-/jobs/3372970952#L39)3)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
    at org.sahli.asciidoc.confluence.publisher.client.http.ConfluenceRestClient.sendRequest(ConfluenceRestClient.java:2[44](https://gitlab.com/group/project/-/jobs/3372970952#L44)
cforce commented 1 year ago

Wrong repo see https://github.com/confluence-publisher/confluence-publisher/issues/302