<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.3dbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Windows-server-2003</id>
	<title>3dbrew - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.3dbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Windows-server-2003"/>
	<link rel="alternate" type="text/html" href="https://www.3dbrew.org/wiki/Special:Contributions/Windows-server-2003"/>
	<updated>2026-04-15T20:31:33Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SSL_Services&amp;diff=21545</id>
		<title>SSL Services</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SSL_Services&amp;diff=21545"/>
		<updated>2021-08-10T01:47:44Z</updated>

		<summary type="html">&lt;p&gt;Windows-server-2003: Added new error code indicating EWOULDBLOCK when calling sslcStartConnection()&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Services]]&lt;br /&gt;
= SSL service &amp;quot;ssl:C&amp;quot; =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Available since system-version&lt;br /&gt;
!  Available from service-sessions&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00010002&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Basically main-only&lt;br /&gt;
| [[SSLC:Initialize|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000200C2&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| &lt;br /&gt;
| [[SSLC:CreateContext|CreateContext]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| &lt;br /&gt;
| [[SSLC:CreateRootCertChain|CreateRootCertChain]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| &lt;br /&gt;
| [[SSLC:DestroyRootCertChain|DestroyRootCertChain]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00050082&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Main-only&lt;br /&gt;
| [[SSLC:AddTrustedRootCA|AddTrustedRootCA]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00060080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Main-only&lt;br /&gt;
| [[SSLC:RootCertChainAddDefaultCert|RootCertChainAddDefaultCert]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00070080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Main-only&lt;br /&gt;
| [[SSLC:RootCertChainRemoveCert|RootCertChainRemoveCert]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| &lt;br /&gt;
| CreateCrlStore. This writes an output u32 to cmdreply[2](created context handle).&lt;br /&gt;
|-&lt;br /&gt;
| 0x00090040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| &lt;br /&gt;
| DestroyCrlStore(u32 contexthandle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A0082&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Main-only&lt;br /&gt;
| AddCrlToCrlStore(u32 contexthandle, u32 size, ((Size&amp;lt;&amp;lt;4)  &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 10), inbufptr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Main-only&lt;br /&gt;
| AddInternalCrlToCrlStore(u32 contexthandle, u8 inval2)&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Main-only&lt;br /&gt;
| RemoveCrlFromCrlStore(u32 contexthandle, u32 certcontexthandle) This removes the specified cert from the context.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D0084&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Main-only&lt;br /&gt;
| [[SSLC:OpenClientCertContext|OpenClientCertContext]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000E0040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Main-only&lt;br /&gt;
| [[SSLC:OpenDefaultClientCertContext|OpenDefaultClientCertContext]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Main-only&lt;br /&gt;
| [[SSLC:CloseClientCertContext|CloseClientCertContext]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00100000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| All&lt;br /&gt;
| [[SSLC:SeedRNG|SeedRNG]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00110042&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| All&lt;br /&gt;
| [[SSLC:GenerateRandomData|GenerateRandomData]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00120042&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| &lt;br /&gt;
| [[SSLC:InitializeConnectionSession|InitializeConnectionSession]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00130040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Context-only&lt;br /&gt;
| [[SSLC:StartConnection|StartConnection]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00140040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Context-only&lt;br /&gt;
| [[SSLC:StartConnectionGetOut|StartConnectionGetOut]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00150082&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Context-only&lt;br /&gt;
| [[SSLC:Read|Read]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00160082&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Context-only&lt;br /&gt;
| [[SSLC:ReadPeek|ReadPeek]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00170082&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| &lt;br /&gt;
| [[SSLC:Write|Write]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00180080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| &lt;br /&gt;
| [[SSLC:ContextSetRootCertChain|ContextSetRootCertChain]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00190080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Context-only&lt;br /&gt;
| [[SSLC:ContextSetClientCert|ContextSetClientCert]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001A0080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Context-only&lt;br /&gt;
| SetCrlStore(u32 [[SSLC:CreateContext|contexthandle]], u32 handle) This writes a context handle created by command 0x00080000 into the session context.&lt;br /&gt;
|-&lt;br /&gt;
| 0x001B0080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Context-only&lt;br /&gt;
| [[SSLC:ContextClearOpt|ContextClearOpt]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001C00C4&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Context-only&lt;br /&gt;
| [[SSLC:ContextGetProtocolCipher|ContextGetProtocolCipher]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001D0040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Context-only&lt;br /&gt;
| GetCertVerificationErrors(u32 [[SSLC:CreateContext|contexthandle]]) Writes an output u32 from the context state to cmdreply[2].&lt;br /&gt;
|-&lt;br /&gt;
| 0x001E0040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| All&lt;br /&gt;
| [[SSLC:DestroyContext|DestroyContext]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001F0082&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Context-only&lt;br /&gt;
| [[SSLC:ContextInitSharedmem|ContextInitSharedmem]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00200082&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Context-only&lt;br /&gt;
| AddEVPolicyID([[SSLC:CreateContext|contexthandle]], u32 size, ((Size&amp;lt;&amp;lt;4)  &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 10), inbufptr)  The input buffer is handled as a string. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Going by strings in the SSL sysmodule it appears the sysmodule uses RSA BSAFE(like certain other 3DS software), this is also likely where the &amp;quot;ssl:C&amp;quot; name comes from(RSA BSAFE &amp;quot;SSL-C&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Similar to HTTPC, each SSL [[SSLC:CreateContext|context]] is used with a dedicated service session which gets opened after creating that context. Following creating the context + opening the service session, [[SSLC:InitializeConnectionSession]] is used from that service session for that context. Afterwards, all commands which require a handle for this context are done with this dedicated service session.&lt;br /&gt;
&lt;br /&gt;
Internally there&#039;s a separate object vtable used with the above SSLC commands, for the main session(where [[SSLC:InitializeConnectionSession]] wasn&#039;t used), and context sessions where [[SSLC:InitializeConnectionSession]] was used. Error 0xD960BBF4 will be returned if a command was used with the wrong session type.&lt;br /&gt;
&lt;br /&gt;
Like some other commands, 0x001F0082 and 0x00200082 are not used by HTTP-sysmodule.&lt;br /&gt;
&lt;br /&gt;
Among commands 0x00180080..0x001B0080 none of them are completely mandatory. However, with the default settings at bare minimum a RootCertChain needs selected otherwise an untrusted-RootCA error will trigger eventually.&lt;br /&gt;
&lt;br /&gt;
It&#039;s unknown whether TLS server-&amp;gt;client connections are supported.&lt;br /&gt;
&lt;br /&gt;
The highest supported TLS protocol version is v1.1(this is the version used by default).&lt;br /&gt;
&lt;br /&gt;
=Commands 0x00080000..0x000C0080=&lt;br /&gt;
These appear to be basically the same as the RootCertChain 0x00030000..0x00070080 commands, except with a different context. The equivalent of RootCertChainAddDefaultCert in this set(0x000B0080) is not usable however.&lt;br /&gt;
&lt;br /&gt;
It&#039;s unknown what this context is actually used for. Trying to use this seems to have no affect on the TLS connection at all, it seems like the cert isn&#039;t even parsed.&lt;br /&gt;
&lt;br /&gt;
=Cert verification=&lt;br /&gt;
The server TLS cert not-before/not-after timestamps are not validated using the system-date which can be set via [[System Settings]](it&#039;s possible these timestamps are not validated at all).&lt;br /&gt;
&lt;br /&gt;
=SSLOpt=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Flag (BIT)&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x000 (??)&lt;br /&gt;
| Don&#039;t verify certificate at all&lt;br /&gt;
|-&lt;br /&gt;
| 0x001 (00)&lt;br /&gt;
| Verify Common Name (CN)&lt;br /&gt;
|-&lt;br /&gt;
| 0x002 (01)&lt;br /&gt;
| Verify RootCA&lt;br /&gt;
|-&lt;br /&gt;
| 0x004 (02)&lt;br /&gt;
| Verify date&lt;br /&gt;
|-&lt;br /&gt;
| 0x008 (03)&lt;br /&gt;
| Verify cert chain&lt;br /&gt;
|-&lt;br /&gt;
| 0x010 (04)&lt;br /&gt;
| Verify &amp;quot;subject alt name&amp;quot; (required for multi-address certificates)&lt;br /&gt;
|-&lt;br /&gt;
| 0x020 (05)&lt;br /&gt;
| Verify cert EV&lt;br /&gt;
|-&lt;br /&gt;
| 0x200 (09)&lt;br /&gt;
| Makes certification validation always succeed&lt;br /&gt;
|-&lt;br /&gt;
| 0x800 (11)&lt;br /&gt;
| Disable use of TLSv1.1 (hence fallback to TLSv1.0)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is the options field initialized during [[SSLC:CreateContext]], and cleared via [[SSLC:ContextClearOpt]]. When the context is initially created, the options field initially has bitmask 0x1B set(besides the additional bits specified via [[SSLC:CreateContext]]).&lt;br /&gt;
&lt;br /&gt;
= Error codes =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Error code&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8A0B801&lt;br /&gt;
| Generic error, it means &amp;quot;this is not an SSL connection&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xD840B802&lt;br /&gt;
| EWOULDBLOCK while trying to read&lt;br /&gt;
|-&lt;br /&gt;
| 0xD840B803&lt;br /&gt;
| EWOULDBLOCK while trying to write&lt;br /&gt;
|-&lt;br /&gt;
| 0xD840B807&lt;br /&gt;
| EWOULDBLOCK while calling sslcStartConnection()&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8A0B805&lt;br /&gt;
| Syscall error, usually means there&#039;s no more data to be read because connection is closed&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8A0B806&lt;br /&gt;
| End-of-stream reached, there is no more data to be read&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8A0B814&lt;br /&gt;
| Server cert verification failed since the RootCA isn&#039;t trusted.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8A0B836&lt;br /&gt;
| The specified RootCertChain handle was not found in the linked-list.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Windows-server-2003</name></author>
	</entry>
</feed>