2009-06-11

IPv6 in OpenSSL

最近的任务是让我们的XML-RPC Server能够在IPv6网络下远程访问。我们的底层数据是用OpenSSL的BIO来处理的,这意味着如果BIO_new_accept()之类直接支持了IPv6,那我的工作就容易许多。可惜的是,目前还不支持。综合搜索的结果来看,我只能手工创建socket,绑定一个IPv6地址,然后将accept之后的socket绑定到某个BIO。试了一下,确实可行。

说实话,openssl的代码不算好读,文档也有所欠缺,很多时候也只能去看源代码。网上抓了OpenSSL-1.0.0-beta2的代码看了一下,确信它在BIO层已经支持IPv6,而目前最新的版本0.9.8k则尚不支持。至于1.0.0何时发布,"The release date is to be set." 没有一个明确的schedule,这让人很郁闷。

下面是个故事:曾有一位RedHat的程序员在06年提交了让BIO支持IPv6的补丁,但被一位OpenSSL开发者拒绝了。摘录一段OpenSSL开发者的回复如下:
OK, to be absolutely sincere. It's not about what Microsoft [or RedHat] supports for the moment, but about exercising above mentioned discipline. It's not about looking for excuses, but exploring maximum possible extent of portability. Is it possible to write code which adapts itself to run-time environment? Regardless whether run-time is supported by vendor or not? How complicated is it? Forget that you're RedHat employee, become programmer instead:-) But this is getting off-topic. DSO_global_lookup was not the point I wanted to emphasize! DSO_global_lookup is mentioned only because you'll have to cope with it in HEAD branch. The main point is that changes of this haracter should be *conditional* for backward compatibility and you have to play by this rules.

现场:

  1. http://rt.openssl.org/Ticket/Display.html?id=1365&user=guest&pass=guest

  2. https://bugzilla.redhat.com/show_bug.cgi?id=198737

  3. https://www.redhat.com/archives/fedora-list/2009-March/msg00362.html


[1]里面记录了OpenSSL maintainer和提交补丁的RedHat Programmer之间的“交锋”; [2]里面记录了RedHat Programmer开发那个补丁的过程;[3]里面则是3年之后对这件事情的回顾。

仔细看了一下1.0.0-beta2的代码,现在的实现还是遵循了OpenSSL自己的discipline。我的疑问:

  1. 各个OpenSource项目有自己的discipline,但很多时候它的文档和discipline并不为成员之外的其他所熟知。出现冲突(实现的细节,风格的审美,可移植性/性能/安全因素等)的时候,patch的提供者和源代码的maintainer各自最理想的行为又是什么?

  2. 事实上,三年前如果OpenSSL的开发者在RedHat程序员的补丁只上稍加改进就能使得BIO直接支持IPv6,但直到三年之后,我们才看见它的存在,况且还是beta2。这真让人沮丧。

标签:

0 Comments:

发表评论

<< Home