What Is this wrapper?
This is the first publicly available .NET wrapper developed for the SSL Labs’ Assessment API’s that allow the consumer to test SSL servers on the public internet.
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.
- The wrapper does NOT use web scrapping like other wrappers which don’t use the assessment API’s.
The wrapper can easily be imported into your project using the NuGet package. The NuGet install command for this package is:
When creating a new instance of the SSL Labs Api wrapper service you must supply the API url during the initialisation. For example in C# this would be expressed as the following:
Below are the method signatures of the SSL Labs Api wrapper service.
The Info method is used to determine if the API is online and returns an Info response object. No input parameters are taken.
The Analyze method is used to initiate an assessment or retrieve results and returns an Analyze response object. The results may only be partial so see the SSL Labs documentation for more information as as GetEndpointDetails call may be needed to view the whole result set.
The wrapper also contains an overloaded Analyze method which only requires the host parameter. Internal is uses the following parameter options - Publish.Off, StartNew.On, FromCache.Ignore, All.On.
The Analyze method is used to initiate and wait for an assessment to complete before retrieving results. Compared to the normal Analyze() method this method keeps checking the Api and only when a scan has finished does it return. This saves the consumer from having to write their own logic for handling an assessment in progress. Another call to GetEndpointDetails() may be needed to view the whole result set for a given endpoint.
The wrapper also contains an overloaded AutomaticAnalyze method which only requires the host parameter. Internal is uses the following parameter options - Publish.Off, StartNew.On, FromCache.Ignore, All.On.
The GetEndpointData method is used to retrieve a full results set for a endpoint and returns an Endpoint response endpoint.
The wrapper also contains an overloaded GetEndpointData method which only requires the host and s parameter. Internal it uses FromCache.Off.
The GetStatusCodes method is use to retrieve a list of status codes and messages which is returned as a StatusCodes response object.
All the response objects are static .NET objects which are populated from the SSL Labs Assessment 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.
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.
A property may be NULL or 0 if the field was NULL or not listed in the API’s response.
Custom parameters are as follows:
If you wish to contribute or view the source code for the wrapper, you can do so from the project’s GitHub page.