bc-java
bc-java copied to clipboard
ESTService.getCSRAttributes can't read response body
ESTService getCSRAttributes can't read response body. ESTException is returned with no body and message: Stream closed before limit fully read, Read: 0 ContentLength: 55 HTTP Status Code: 404
getCACerts and simpleEnroll can do it w/o problems, the server behaves the same for all cases.
If you can provide a sample response we might be able to work out what's going on.
As far as I remember it was 404 response with 55 bytes of data as error message in JSON format.
So the issue was generating a response that the server couldn't read?
Opposite, server was responding with 404 and body. Give me an hour I'll bring my setup and try to reproduce the issue.
Here is what happens. Server responds with 404 and some body.
getCsrAttributes comes to the line
https://github.com/bcgit/bc-java/blob/master/pkix/src/main/java/org/bouncycastle/est/ESTService.java#L540
than continue to
https://github.com/bcgit/bc-java/blob/master/pkix/src/main/java/org/bouncycastle/est/ESTService.java#L566
which throws java.io.IOException: Stream closed before limit fully read, Read: 0 ContentLength: 45