资源描述:
《ssl journal - an introduction to openssl programming》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、AnIntroductiontoOpenSSLProgramming,PartIofIIPage1de5SearchTopicsAllTopicsCreateanaccountHome·Subscribe·Topics·Advertise·VendorPressLinuxJournal·HomeIssue89:AnIntroductiontoOpenSSLProgramming,PartIofII·Subscribe/RenewPostedonSaturday,September01,2001byEricRescorla·ChangeAddress·SubscriberServic
2、esDoyouhaveaburningneedtobuildasimplewebclientandserverpair?Here'swhyOpenSSLisforyou.ThequickestandeasiestwaytosecureaTCP-basednetworkapplicationiswithSSL.Ifyou'reworkinginC,·AdvertiseinLJyourbestchoiceisprobablytouseOpenSSL(http://www.openssl.org/).OpenSSLisafree(BSD-stylelicense)·LJPressRele
3、asesimplementationofSSL/TLSbasedonEricYoung'sSSLeaypackage.Unfortunately,thedocumentationandsamplecode·VendorPressdistributedwithOpenSSLleavesomethingtobedesired.Wheretheyexist,themanualpagesareprettygood,buttheyReleasesoftenmissthebigpicture,asmanualpagesareintendedasareference,notatutorial.·
4、WriteforUs·ContactUsTheOpenSSLAPIisvastandcomplicated,sowewon'tattempttoprovideanythinglikecompletecoveragehere.Rather,theideaistoteachyouenoughtoworkeffectivelyfromthemanualpages.Inthisarticle,thefirstoftwo,weOtherOptionswillbuildasimplewebclientandserverpairthatdemonstratethebasicfeaturesofO
5、penSSL.Inthesecondarticle,wewillintroduceanumberofadvancedfeatures,suchassessionresumptionandclientauthentication.·FAQ·MembersListIassumethatyou'realreadyfamiliarwithSSLandHTTP,atleastataconceptuallevel.Ifyou'renot,agoodplacetostartiswiththeRFCs(seeResources).NowAvailable!Forspacereasons,thisa
6、rticleonlyincludesexcerptsfromthesourcecode.Thecompletesourcecodeisavailableinmachine-readableformatfromtheauthor'swebsiteathttp://www.rtfm.com/openssl-examples/.ProgramsOurclientisasimpleHTTPS(seeRFC2818)client.ItinitiatesanSSLconnectiontotheserverandthentransmitsanHTTPrequestoverthatconnecti
7、on.Itthenwaitsfortheresponsefromtheserverandprintsittothescreen.ThisisavastlysimplifiedversionofthefunctionalityfoundinprogramslikefetchandcURL.KernelWatchNuts2.5.69TheserverprogramisasimpleHTTPSserver.ItwaitsforTCPconnectionsfromclient