如何使用Schannel API添加SNI客户端hello扩展? [英] How to add SNI client hello extension using Schannel API?

查看:149
本文介绍了如何使用Schannel API添加SNI客户端hello扩展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将SNI添加到我的客户端程序(C / C ++)中,该程序使用Microsoft SDK的Schannel API for TLS。

我搜索到了所有地方但找不到关于Schannel如何支持SNI扩展的任何文档。

我查找了AcquireCredentialsHandle(),InitializeSecurityContext()的文档,但没有成功。

所以,有人可以帮助吗我用一些示例代码显示客户端如何在客户端hello扩展中指定SNI(以及它想要连接的服务器名称)?



谢谢,

--ANURAG。

I'm trying to add SNI to my client-side program (C/C++) that uses Microsoft SDK's Schannel API for TLS.
I've searched everywhere but could not find any documentation on how Schannel supports SNI extension.
I looked up the documentation for  AcquireCredentialsHandle(), InitializeSecurityContext() but without success.
So, could anyone please help me with some example code that shows how the client specifies SNI (and the server name it wants to connect to) in it's client hello extension?

Thanks,
--ANURAG.

推荐答案

2015年5月11日6:44 AM,Anurag.S.Sharma写道:

On 5/11/2015 6:44 AM, Anurag.S.Sharma wrote:


我正在尝试将SNI添加到我使用的客户端程序(C / C ++) Microsoft SDK用于TLS的Schannel API。

我在各处搜索但找不到有关Schannel如何支持SNI扩展的任何文档。

I'm trying to add SNI to my client-side program (C/C++) that uses Microsoft SDK's Schannel API for TLS.
I've searched everywhere but could not find any documentation on how Schannel supports SNI extension.

据我所知l,SChannel会自动为所有请求添加SNI扩展,除非使用SCH_CRED_NO_SERVERNAME_CHECK标记进行抑制。

As far as I can tell, SChannel automatically adds SNI extension to all requests, unless suppressed with SCH_CRED_NO_SERVERNAME_CHECK flag.


所以,有人可以帮我一些示例代码,说明如何客户端在客户端hello扩展中指定SNI(以及它想要连接的服务器名称)?

So, could anyone please help me with some example code that shows how the client specifies SNI (and the server name it wants to connect to) in it's client hello extension?

服务器名称在InitializeSecurityContext中通过pszTargetName参数指定。

The server name is specified in InitializeSecurityContext, via pszTargetName parameter.


这篇关于如何使用Schannel API添加SNI客户端hello扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆