|
1 | 1 | SSLLWrapper
|
2 | 2 | ===========
|
3 | 3 |
|
4 |
| -SSLLWrapper stands for SSL Labs Wrapper which I believe is the first .NET wrapper developed for the new [SSL Labs' Assessment API's](https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs.md) that allow the consumer to test SSL servers on the public internet. |
| 4 | +SSLLWrapper stands for SSL Labs Wrapper which is the first publicly available .NET wrapper developed for the [SSL Labs' Assessment API's](https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs.md) that allow the consumer to test SSL servers on the public internet. |
5 | 5 |
|
6 | 6 | This wrapper easies the communication to the API's for .NET developers which allows you as the developer to focus on your project rather than managing the plumbing and overhead required to consume the API's.
|
7 | 7 |
|
8 | 8 | **Notes**
|
9 | 9 | - SSL Labs' Assessment API's are currently still in development and are subject to change.
|
10 | 10 | - The wrapper is currently still in development aswell though is in a functional beta stage.
|
11 |
| -- The wrapper will be available as NuGet package shortly. |
12 | 11 | - The wrapper does **NOT** use web scrapping like other wrappers which don't use the assesment API's.
|
13 | 12 |
|
14 |
| -## Wrapper Usage |
| 13 | +### NuGet Package |
| 14 | +The wrapper can easily be imported into your project using the [SSLLWrapper NuGet package](https://www.nuget.org/packages/SSLLWrapper/). The NuGet install command for this package is: |
15 | 15 |
|
16 |
| -### Methods |
17 |
| -**Info()** |
| 16 | +**PM> Install-Package SSLLWrapper** |
18 | 17 |
|
19 |
| -**Anaylze()** |
| 18 | +### Wrapper Usage |
| 19 | +When creating a new instance of SSLLWrapper you must supply the API url during the initialization. For example in C# this would be expressed as the following: |
| 20 | +```C# |
| 21 | +var service = new SSLLWrapper.Service("https://api.dev.ssllabs.com/api/fa78d5a4"); |
20 | 22 |
|
21 |
| -**GetEndpointDetails()** |
| 23 | +// Or if you use the SSLWrapper namespace this can be shorten to |
| 24 | +var service = new Service("https://api.dev.ssllabs.com/api/fa78d5a4"); |
| 25 | +``` |
| 26 | +#### Methods |
22 | 27 |
|
23 |
| -**GetStatusCodes()** |
| 28 | +Below are the method signatures of the SSLLWrapper Service. |
24 | 29 |
|
25 |
| -### Response Objects |
26 |
| -**Info** |
| 30 | +##### Info() |
27 | 31 |
|
28 |
| -**Anaylze** |
| 32 | +The Info method is used to determin if the API is online and returns an [Info response object](https://github.com/AshleyPoole/SSLLWrapper/blob/master/README.md#info-1). No input parameters are taken. |
29 | 33 |
|
30 |
| -**Endpoint** |
| 34 | +##### Analyze() |
31 | 35 |
|
32 |
| -**StatusDetails** |
| 36 | +The Analyze method is used to initiate an assessment or retrieve results. The results may only be partial so see SSL Labs documentation for more information as as GetEndpointDetails call may be needed to view the whole result set. |
33 | 37 |
|
34 |
| -## To Do |
| 38 | +```C# |
| 39 | +public Analyze Analyze(string host, Publish publish, ClearCache clearCache, FromCache fromCache, All all) |
| 40 | +``` |
| 41 | + |
| 42 | +The wrapper also contains an overloaded Analyze method which only requires the host parameter. Internal is uses the following paramter options - Publish.Off, ClearCache.On, FromCache.Ignore, All.On. |
| 43 | +```C# |
| 44 | +public Analyze Analyze(string host) |
| 45 | +``` |
| 46 | + |
| 47 | +##### GetEndpointDetails() |
| 48 | + |
| 49 | +The GetEndPointDetails method is used to retrieve a fully results set. |
| 50 | +```C# |
| 51 | +public Endpoint GetEndpointData(string host, string s, FromCache fromCache) |
| 52 | +``` |
| 53 | + |
| 54 | +The wrapper also contains an overloaded GetEndpointDetail method which only requires the host and s parameter. Internal is uses FromCache.Off. |
| 55 | +```C# |
| 56 | +public Endpoint GetEndpointData(string host, string s) |
| 57 | +``` |
| 58 | + |
| 59 | +##### GetStatusCodes() |
| 60 | + |
| 61 | +The GetStatusCodes method is use to retrieve a list of status codes and messages. |
| 62 | +```C# |
| 63 | +public StatusDetails GetStatusCodes() |
| 64 | +``` |
| 65 | + |
| 66 | +#### Response Objects |
| 67 | + |
| 68 | +All the response objects are static .NET objects which are populated from the SSL Labs Assement API's result. Due to the response models are based on those derived from the API itself I will only provide a top level response model map. For more information on the properties available check out [their documentation](https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs.md#response-objects). |
| 69 | + |
| 70 | +All response objects also inherit from a custom BaseModel to extent the usability to you as the developer, as well as core functionality needed to consume the API's. The properties are listed below for all top level or custom response objects. |
| 71 | + |
| 72 | +A property may be NULL or 0 if the field was NULL or not listed in the API's response. |
| 73 | + |
| 74 | +##### BaseModel |
| 75 | +```C# |
| 76 | +public Header Header { get; set; } |
| 77 | +public bool HasErrorOccurred { get; set; } |
| 78 | +public List<Error> Errors { get; set; } |
| 79 | + |
| 80 | +public class Header |
| 81 | +{ |
| 82 | + public int statusCode { get; set; } |
| 83 | + public string statusDescription { get; set; } |
| 84 | +} |
| 85 | + |
| 86 | +public class Error |
| 87 | +{ |
| 88 | + public string field { get; set; } |
| 89 | + public string message { get; set; } |
| 90 | +} |
| 91 | +``` |
| 92 | + |
| 93 | +##### Info |
| 94 | +```C# |
| 95 | +public string engineVersion { get; set; } |
| 96 | +public string criteriaVersion { get; set; } |
| 97 | +public int clientMaxAssessments { get; set; } |
| 98 | +public string notice { get; set; } |
| 99 | +public bool Online { get; set; } |
| 100 | +``` |
| 101 | + |
| 102 | +##### Analyze |
| 103 | +```C# |
| 104 | +public string host { get; set; } |
| 105 | +public int port { get; set; } |
| 106 | +public string protocol { get; set; } |
| 107 | +public bool isPublic { get; set; } |
| 108 | +public string status { get; set; } |
| 109 | +public long startTime { get; set; } |
| 110 | +public string engineVersion { get; set; } |
| 111 | +public string criteriaVersion { get; set; } |
| 112 | +public List<Endpoint> endpoints { get; set; } |
| 113 | +``` |
| 114 | + |
| 115 | +##### Endpoint |
| 116 | +```C# |
| 117 | +public string ipAddress { get; set; } |
| 118 | +public string statusMessage { get; set; } |
| 119 | +public string statusDetails { get; set; } |
| 120 | +public string statusDetailsMessage { get; set; } |
| 121 | +public int progress { get; set; } |
| 122 | +public int eta { get; set; } |
| 123 | +public int delegation { get; set; } |
| 124 | +public int duration { get; set; } |
| 125 | +public string grade { get; set; } |
| 126 | +public bool hasWarnings { get; set; } |
| 127 | +public bool isExceptional { get; set; } |
| 128 | +public Details Details { get; set; } |
| 129 | +``` |
| 130 | + |
| 131 | +##### StatusDetails |
| 132 | +```C# |
| 133 | +public string TESTING_PROTOCOL_INTOLERANCE_399 { get; set; } |
| 134 | +public string PREPARING_REPORT { get; set; } |
| 135 | +public string TESTING_SESSION_RESUMPTION { get; set; } |
| 136 | +public string TESTING_NPN { get; set; } |
| 137 | +public string RETRIEVING_CERT_V3__NO_SNI { get; set; } |
| 138 | +public string RETRIEVING_CERT_V3__SNI_APEX { get; set; } |
| 139 | +public string TESTING_CVE_2014_0224 { get; set; } |
| 140 | +public string TESTING_CAPABILITIES { get; set; } |
| 141 | +public string TESTING_HEARTBLEED { get; set; } |
| 142 | +public string TESTING_PROTO_3_3_V2H { get; set; } |
| 143 | +public string TESTING_SESSION_TICKETS { get; set; } |
| 144 | +public string VALIDATING_TRUST_PATHS { get; set; } |
| 145 | +public string TESTING_RENEGOTIATION { get; set; } |
| 146 | +public string TESTING_HTTPS { get; set; } |
| 147 | +public string TESTING_V2H_HANDSHAKE { get; set; } |
| 148 | +public string TESTING_STRICT_RI { get; set; } |
| 149 | +public string TESTING_SUITES_DEPRECATED { get; set; } |
| 150 | +public string TESTING_HANDSHAKE_SIMULATION { get; set; } |
| 151 | +public string TESTING_STRICT_SNI { get; set; } |
| 152 | +public string TESTING_PROTO_3_1_V2H { get; set; } |
| 153 | +public string TESTING_PROTOCOL_INTOLERANCE_499 { get; set; } |
| 154 | +public string TESTING_TLS_VERSION_INTOLERANCE { get; set; } |
| 155 | +public string TESTING_PROTOCOL_INTOLERANCE_304 { get; set; } |
| 156 | +public string TESTING_SUITES_BULK { get; set; } |
| 157 | +public string TESTING_BEAST { get; set; } |
| 158 | +public string TESTING_PROTO_2_0 { get; set; } |
| 159 | +public string BUILDING_TRUST_PATHS { get; set; } |
| 160 | +public string TESTING_PROTO_3_1 { get; set; } |
| 161 | +public string TESTING_PROTO_3_0_V2H { get; set; } |
| 162 | +public string TESTING_PROTO_3_0 { get; set; } |
| 163 | +public string TESTING_PROTOCOL_INTOLERANCE_300 { get; set; } |
| 164 | +public string TESTING_PROTOCOL_INTOLERANCE_301 { get; set; } |
| 165 | +public string TESTING_PROTOCOL_INTOLERANCE_302 { get; set; } |
| 166 | +public string TESTING_PROTOCOL_INTOLERANCE_303 { get; set; } |
| 167 | +public string TESTING_OCSP_STAPLING_PRIME { get; set; } |
| 168 | +public string TESTING_EXTENSION_INTOLERANCE { get; set; } |
| 169 | +public string TESTING_SSL2_SUITES { get; set; } |
| 170 | +public string TESTING_OCSP_STAPLING { get; set; } |
| 171 | +public string TESTING_SUITES { get; set; } |
| 172 | +public string TESTING_PROTO_3_2_V2H { get; set; } |
| 173 | +public string TESTING_POODLE_TLS { get; set; } |
| 174 | +public string RETRIEVING_CERT_V3__SNI_WWW { get; set; } |
| 175 | +public string CHECKING_REVOCATION { get; set; } |
| 176 | +public string TESTING_COMPRESSION { get; set; } |
| 177 | +public string TESTING_SUITE_PREFERENCE { get; set; } |
| 178 | +public string TESTING_PROTO_3_2 { get; set; } |
| 179 | +public string TESTING_PROTO_3_3 { get; set; } |
| 180 | +public string TESTING_LONG_HANDSHAKE { get; set; } |
| 181 | +``` |
| 182 | + |
| 183 | +#### To Do |
35 | 184 | - Flesh out SSLWrapper.Tests project to ensure as most code as appropiate is tesed
|
36 | 185 | - General refractor
|
37 | 186 |
|
38 |
| -## Author |
| 187 | +### Author |
39 | 188 | Ashley Poole - www.ashleypoole.co.uk.
|
40 | 189 |
|
41 | 190 | Please contact me if you have any questions, issues or recommendations either via [my website ](http://www.ashleypoole.co.uk), [Twitter ](http://twitter.com/geekypants92) or [by email ](mailto:[email protected]).
|
0 commit comments