Friday, May 20, 2011

Multiple SSL with Virtual Hosts Using SNI

Summary

Using name-based virtual hosts with SSL adds another layer of complication. Without the SNI extension, it's not generally possible (though a subset of virtual host might work). With SNI, it's necessary to consider the configuration carefully to ensure security is maintained.

The Problem

The problem with using named virtual hosts over SSL is that named virtual hosts rely on knowing what hostname is being requested, and the request can't be read until the SSL connection is established. The ordinary behavior, then, is that the SSL connection is set up using the configuration in the default virtual host for the address where the connection was received.

While Apache can renegotiate the SSL connection later after seeing the hostname in the request (and does), that's too late to pick the right server certificate to use to match the request hostname during the initial handshake, resulting in browser warnings/errors about certificates having the wrong hostname in them.

And while it's possible to put multiple hostnames in a modern certificate and just use that one certificate in the default vhost, there are many hosting providers who are hosting far too many sites on a single address for that to be practical for them.

Prerequisites to use SNI
  • Use OpenSSL 0.9.8f or later
  • Build OpenSSL with the TLS Extensions option enabled (option enable-tlsext; OpenSSL 0.9.8k and later has this enabled by default).
  • Apache must have been built with that OpenSSL (./configure --with-ssl=/path/to/your/openssl). In that case, mod_ssl will automatically detect the availability of the TLS extensions and support SNI.
  • Apache must use that OpenSSL at run-time, which might require setting LD_LIBRARY_PATH or equivalent to point to that OpenSSL, maybe in bin/envvars. (You'll get unresolved symbol errors at Apache startup if Apache was built with SNI but isn't finding the right openssl libraries at run-time.)

How can you tell if your Apache build supports SNI? If you configure multiple name-based virtual hosts for an address where SSL is configured, and SNI isn't built into your Apache, then upon Apache startup a message like "You should not use name-based virtual hosts in conjunction with SSL!!" will occur in the error log. If SNI is built in, then the error log will show "[warn] Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)".

The client browser must also support SNI. Here are some browsers that do:
  • Mozilla Firefox 2.0 or later
  • Opera 8.0 or later (with TLS 1.1 enabled)
  • Internet Explorer 7.0 or later (on Vista, not XP)
  • Google Chrome
  • Safari 3.2.1 on Mac OS X 10.5.6
Environment variables

When Apache supports SNI and the client provided the hostname using SNI, the new environment variable SSL_TLS_SNI will be set to the hostname that the client provided.

Scenarios

SNI/Request hostname mismatch, or SNI provides hostname and request doesn't.
This is a browser bug. Apache will reject the request with a 400-type error.
Client doesn't support SNI.

If Apache has SNI support, and a request without the SNI hostname is received for a name-based virtual host over SSL, and SSLStrictSNIVHostCheck is on, it will be rejected (403) and this message logged:

 [error] No hostname was provided via SNI for a name based virtual host

If SSLStrictSNIVHostCheck is off, then the request will be handled as if the server did not have SNI support; see above.

Example configuration

# Ensure that Apache listens on port 443
Listen 443
 
# Listen for virtual host requests on all IP addresses
NameVirtualHost *:443

# Go ahead and accept connections for these vhosts
# from non-SNI clients
SSLStrictSNIVHostCheck off


  # Because this virtual host is defined first, it will
  # be used as the default if the hostname is not received
  # in the SSL handshake, e.g. if the browser doesn't support
  # SNI.
  DocumentRoot /www/example1
  ServerName www.example.com

  # Other directives here

  DocumentRoot /www/example2
  ServerName www.example2.org

  # Other directives here

For more please refer:


Friday, March 11, 2011

Head Massage

Self massage might be helpful when doctor is not around, no harm to try :)


Sensory touches at the bottom of your foot

The Organs of your body have their sensory touches at the bottom of your foot, if you massage these points you will find relief from aches and pains as you can see the heart is on the left foot.

Typically they are shown as points and arrows to show which organ it connects to.
It is indeed correct since the nerves connected to these organs terminate here.
This is covered in great details in Acupressure studies or textbooks.
God created our body so well that he thought of even this. He made us walk so that we will always be pressing these pressure points and thus keeping these organs activated at all times.

So, keep walking...

Wednesday, March 9, 2011

The Incredible Climbing Mountain Goats

The Incredible Climbing Mountain Goats 
You might think you have mad mountain-climbing skills, but nature’s got you beat. I don’t know how they do it, but these mountain goats climb on to the most precarious places.
Living in mountainous regions around North America, mountain goats can be found at altitudes of up to 13,000 feet, climbing cliffs all day long, in search of food. Thanks to their cloven hooves, each featuring two widely-spaced toes that provide great balance, mountain goats can challenge any seasoned climber and probably best him.
Their double-layered, thick white coats provide camouflage in snowy settings, but the altitude they can reach provides enough protection from most predators. And if they happen to run into trouble, they can jump 12 feet in one leap, and reach a safe point. Just check out the pics to get an idea of their climbing capabilities.










Tuesday, March 8, 2011

I spent 3 second to found something in this picture and made me laugh!


I spent 3 second to found something funny in this picture and made me laugh!  Some people could take more times... you must stare at the photo before you laugh! :)

Friday, January 21, 2011

超实用60条日常生活冷知识

1.吃了辣的东西,感觉就要被辣死了,就往嘴里放上少许盐,含一下,吐掉,漱下口,就不辣了

2.牙齿黄,可以把花生嚼碎后含在嘴里,并刷牙三分钟,很有效;

3.若有小面积皮肤损伤或者烧伤、烫伤,抹上少许牙膏,可立即止血止痛;

4.经常装茶的杯子里面留下难看的茶渍,用牙膏洗之,非常干净;

5.仰头点眼药水时微微张嘴,这样眼睛就不会乱眨了;

6.嘴里有溃疡,就用维生素C贴在溃疡处,等它溶化后溃疡基本就好了;

7.眼睛进了小灰尘,闭上眼睛用力咳嗽几下,灰尘就会自己出来;

8.洗完脸后,用手指沾些细盐在鼻头两侧轻轻按摩,然后再用清水冲洗,黑头和粉刺就会清除干净,毛细孔也会变

9.刚刚被蚊子咬完时,涂上肥皂就不会痒了;

10.如果嗓子、牙龈发炎了,在晚上把西瓜切成小块,沾着盐吃,记得一定要是晚上,当时症状就会减轻,第二天就好了;

11.吹风机对着标签吹,等吹到商标的胶热了,就可以很容易的把标签撕下来;

12.旅行带衣服时如果怕压起褶皱,可以把每件衣服都卷成卷;

13.打打嗝时就喝点醋,立杆见影;

14.吃了有异味的东西,如大蒜、臭豆腐,吃几颗花生米就好了;

15.治疗咳嗽,特别是干咳,晚上睡觉前,用纯芝麻香油煎鸡蛋,油放稍多些,什么调味料都不要放,趁热吃过就去睡觉,连吃几天效果很明显;

16.手腕长粗的MM想带较细的手镯,就不能硬带,应把手上套上一个塑料袋再带上手镯,非常好带,也不会把手弄疼,取下也是同样的方法;

17.栗子皮难剥,先把外壳剥掉,再把它放进微波炉转一下,拿出后趁热一搓,皮就掉了;

18.插花时,在水里滴上一滴洗洁精,可以维持好几天;

19.把核桃放进锅里蒸十分钟,取出放在凉水里再砸开,就能取出完整的桃核仁了;

20.把虾仁放进碗里,加一点精盐、食用碱粉,用手抓搓一会儿后用清水浸泡,然后再用清水冲洗,即能使炒出的虾仁透明如水晶,爽嫩可口;

21.炒肉时,先把肉用小苏打水浸泡十几分钟,倒掉水,再入味,炒出来会很嫩滑;

22.将残茶叶浸入水中数天后,浇在植物根部,可促进植物生长;

23.把残茶叶晒干,放到厕所或者沟渠里燃熏,可消除恶臭,具有驱除蚊子苍蝇的功能

24.夹生饭重煮法:可用筷子在饭内扎些直通锅底的孔,洒入少许黄酒重焖,

25.若只表面夹生,只要将表层翻到中间再焖即可;

26.巧除纱窗油腻:将洗衣服、吸烟剩下的烟头一起放在水里,待溶解后,拿来擦玻璃窗、纱窗,效果真不错;

27.只要在珠宝盒中放上一节小小的粉笔,即可让首饰常保光泽;

28.桌子、瓶子表面的不干胶痕迹用风油精可以擦拭;

29.出门时随时在包里带一节小的干电池,若裙子带静电,就把电池的正极在裙子上面擦几下即可去掉静电;

30.不管是鞋子的哪个地方磨到了你的脚,你就在鞋子磨脚的地方涂一点点白酒,保证就不磨脚了;

31.亨调蔬菜时,如果必须要焯,焯好菜的水最好尽量利用。如做水饺的菜,焯好的水可适量放在肉馅里,这样既保证营养,又使水饺馅味美有汤;

32.夏天足部容易出汗,每天用淡盐水泡脚可有效应对汗脚;

33.夏天游泳后晒晒太阳,可防肌肤劳损等疾病发生;

34.夏天枕头易受潮滋生霉菌,时常曝晒枕芯有利健康;

35.多吃薏米小豆粥等潮湿健脾,可防暑湿;

36.防失眠:睡前少讲太多话,忌饮浓茶,睡前勿大用脑,可用热水加醋洗脚;

37.金银花有疏散风湿功效,金银花水煎取汁凉后与蜂蜜冲调可解暑;

38.吃过于肥腻的食物后喝茶,能刺激自律神经,促进脂肪代谢;

39.睡眠不足会变笨,一天需要睡眠八小时,有午睡习惯可延缓衰老;

40.双手易变得干燥粗糙,用醋泡手十分钟可护肤;

41.夏天擦拭凉席,用滴加了花露水的清水擦拭凉席,可使凉席保持清爽洁净。当然,擦拭时最好沿着凉席纹路进行,以便花露水渗透到凉席的纹路缝隙,这样清凉舒适的感觉会更持久;

42.早餐多食西红柿、柠檬酸等酸性蔬菜和水果,有益于养肝;

43.爽身止痒洗头或洗澡时,在水中加五六滴花露水,能起到很好的清凉除菌、祛痱止痒作用;

44.葡萄含有睡眠辅助激素,常食有助睡眠;

45.夏天多喝番茄汤既可获得养料,又能补充水分,番茄汤应烧好并冷却后再喝,所含番茄红素有一定的抗前列腺癌和保护心肌的功效,最适合于男子;吃酸性物质马上刷牙会损害牙齿健康;

46.因外伤碰破皮肉时,在伤处涂上牙膏进行消炎、止血,再包扎,作为临时急救药,以药物牙膏效果最为显著;

47.将白醋喷洒在菜板上,放上半小时后再洗,不但能杀菌,还能除味;

48.喝酸奶能解酒后烦躁,酸奶能保护胃黏膜、延缓酒精吸收,并且含钙丰富,对缓解酒后烦躁尤其有

49.皮鞋包皮放久了发霉时,可用软布蘸酒精加水(1:1)溶液擦拭即可;

50.发生头痛、头晕时,可在太阳穴涂上牙膏,因为牙膏含有薄荷脑、丁香油可镇痛;

51.蜡烛冷冻二十四小时后,再插到生日蛋糕上,点燃时不会流下烛油;

52.白色衣裤洗后易泛黄,可取一盆清水,滴上二三滴蓝墨水,将洗过的衣裤在浸泡一刻钟,不必拧干,就放在太阳下晒,即可洁白干净;

53.过多食用生葱蒜会刺激口腔肠胃,不利健康,最好加一点醋再食用;

54.及时补充水分但应少喝果汁、可乐、雪碧、汽水等饮料,含有较多的糖精和电解质,喝多了会对肠胃产生不良刺激,影响消化和食欲。因此夏天应多喝白开水或淡盐(糖)水;

55.每天早晨用豆腐摩擦面部几分钟,坚持一个月,面部会变得很滋润;

56.空调室内温差不宜超过五度,即使天气再热,空调室内温度也不宜到24度以下;

57.加酶洗衣粉剂放在温水中需要较长的分解时间才能使洗衣效果更佳;

58.夏天,人的活动时间变长,出汗多,耗能过大,应适当多吃鸡、鸭、瘦肉、鱼类、蛋类等营养食品,以满足人体的代谢需要;

59.头痛时把苹果磨成泥状涂在纱布上,贴在头痛处,症状可减轻;

60.皮包上有污渍,可以用棉花蘸风油精擦拭.

Thursday, January 6, 2011

以后旅游一定不要买“玉”

以后旅游一定不要买
太恐怖了! 

很多朋友对翡翠的知识并不是太了解,有时候认为很实惠的买了个宝贝,殊不知是买了个危害,钱花了无所谓,但是戴在身上的却是会长期释放毒素及放射性元素的 高致癌宝贝,下面先让各位看看恐怖的翡翠洗底过程

俗称的石头料,没水、没底、没色!

恐怖!用强酸以及包含大量放射元素的化学制剂浸泡石料半个月!

化学物洗涤后的效果!

对洗过底的石料人工加色

进入真空高压注胶机,再次用剧毒的化学物品注胶!

注胶过程同样需要几天时间!

半成品出炉,原来的毛料已经有水色了!


成品展示!一般市场价叫个78万,还价就卖!