zhuzengpeng / jscep

Automatically exported from code.google.com/p/jscep
MIT License
0 stars 0 forks source link

CaCapabilitiesContentHandler getContent throws NullPointerException if Content-Type is not set #56

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an instance of the org.jscep.client.Client java class, as described 
on the wiki page, with a URL pointing to a Windows 2008 R2 NDES server
2. Call any method on the Client object that indirectly causes a GetCACaps 
operation to be sent (e.g. Client.enrol).
3. A NPE is thrown in CaCapabilitiesContentHandler.getContent

What is the expected output? What do you see instead?
Since GetCACaps is an optional operation, JSCEP should expect an empty HTTP 
response (with no requirements on the content-type).

What version of the product are you using? On what operating system?
Trunk (rev. 1326).

Please provide any additional information below.
NDES server returns an empty HTTP response on a GetCACaps call, with 
content-length 0 and no content-type set. URLConnection.getContentType will 
return null since no content-type is set in the response. This causes the 
mimeType parameter of CaCapabilitiesContentHandler.getContent to be null.

See patch attached for a simple solution to the problem.

Microsoft has released a patch for NDES, that enables GetCACaps support:
http://support.microsoft.com/kb/2483564/d

Still, it would be good if JSCEP could handle an unpatched server, since 
GetCACaps is optional to implement.

Original issue reported on code.google.com by kvarnham...@gmail.com on 2 Nov 2011 at 8:49

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by da...@grant.org.uk on 2 Nov 2011 at 8:51

GoogleCodeExporter commented 9 years ago

Original comment by da...@grant.org.uk on 2 Nov 2011 at 8:51

GoogleCodeExporter commented 9 years ago
Issue 52 has been merged into this issue.

Original comment by da...@grant.org.uk on 19 Jan 2012 at 7:11

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1327.

Original comment by da...@grant.org.uk on 19 Jan 2012 at 8:06

GoogleCodeExporter commented 9 years ago

Original comment by da...@grant.org.uk on 22 Mar 2012 at 8:43

GoogleCodeExporter commented 9 years ago

Original comment by da...@grant.org.uk on 21 Aug 2012 at 11:58

GoogleCodeExporter commented 9 years ago
Issue 52 has been merged into this issue.

Original comment by da...@grant.org.uk on 21 Aug 2012 at 12:26