什么是SSL上下文? [英] What is SSL context?

查看:602
本文介绍了什么是SSL上下文?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在为SSL编程时,无论选择哪种语言(C ++,Java,Ruby等),都可能会遇到要使用的SSLContext对象.我不知道SSLContext的语义是什么?当我在google上搜索它时,仅出现了许多页面,这些页面解释了这种对象在各种编程语言中的句法用法.

When programming for a SSL, no matter which language you choose (C++, Java, Ruby etc.), you probably encounter SSLContext object which would be used. I do not know what does SSLContext semantically means? When I search google for it, there just come many pages explaining the syntactical usage of such object for various programming languages.

我的问题:SSLContext在SSL方面意味着/做什么?不管实现它的语言是什么.

My Question: What does SSLContext mean/do in terms of SSL? Regardless of the language which implements it.

推荐答案

SSL Context is a collection of ciphers, protocol versions, trusted certificates, TLS options, TLS extensions etc. Since it is very common to have multiple connections with the same settings they are put together in a context and the relevant SSL connections are then created based on this context. And to create a new connection you need only refer to the context which thus saves time and memory compared to the case you would have to re-create of all these settings.

@EJP很好地将此集合"描述为工厂. SSL上下文与 SSL会话不同甚至两者都是设置的集合.会话是您在SSL握手之后获得的,它仅涵盖了双方都同意的密码和协议版本以及交换的密钥.上下文涵盖所有密码和协议版本以及受信任证书的列表,而本地系统(客户端或服务器)在建立新的TLS连接时愿意支持.因此,SSL会话描述了已建立的SSL关系,而SSL上下文则描述了建立SSL关系所需的条件.

@EJP nicely describes this "collection" as factory. A SSL context is not the same as a SSL session even both are collections of settings. A session is what you get after the SSL handshake and covers only the cipher and protocol version both parties agreed on and also the exchanged key. Whereas the context covers all the ciphers and protocol versions and also the list of trusted certificates the local system (client or server) is willing to support when establishing a new TLS connection. Thus a SSL session describes an established SSL relation while the SSL context describes what you need to establish an SSL relation.

这篇关于什么是SSL上下文?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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