当前位置: 首页 > news >正文

网站建设pdf文件怎么发布网站建设框架文档

网站建设pdf文件怎么发布,网站建设框架文档,宿迁市工厂外包工加工,黄页88网推广服务免费如果您看过我的上一个博客#xff0c;您会知道我列出了Spring Security可以做的十件事 。 但是#xff0c;在认真开始使用Spring Security之前#xff0c;您真正要做的第一件事就是确保您的Web应用使用正确的传输协议#xff0c;在这种情况下为HTTPS –毕竟#xff0c;没有… 如果您看过我的上一个博客您会知道我列出了Spring Security可以做的十件事 。 但是在认真开始使用Spring Security之前您真正要做的第一件事就是确保您的Web应用使用正确的传输协议在这种情况下为HTTPS –毕竟没有一个安全的网站是没有意义的如果您要在互联网上以纯文本格式广播用户密码。 要设置SSL需要执行三个基本步骤…… 创建密钥库 您需要的第一件事是包含有效证书的私有密钥库生成其中一个证书的最简单方法是使用位于$JAVA_HOME/bin目录中的Java的keytool实用程序。 keytool -genkey -alias MyKeyAlias -keyalg RSA -keystore /Users/Roger/tmp/roger.keystore 在以上示例中 -alias是密钥的唯一标识符。 -keyalg是用于生成密钥的算法。 您在网络上找到的大多数示例通常都引用“ RSA”但是您也可以使用“ DSA”或“ DES” -keystore是一个可选参数用于指定密钥存储文件的位置。 如果缺少此参数则默认位置是$ HOME目录。 RSA代表Ron Rivest也是RC4算法的创建者Adi Shamir和Leonard Adleman DSA代表数字签名算法 DES代表数据加密标准 有关keytool及其参数的更多信息 keytool 参阅Jon Svede的Informit文章。 当您运行此程序时系统会提示您一些问题 Roger$ keytool -genkey -alias MyKeyAlias -keyalg RSA -keystore /Users/Roger/tmp/roger.keystore Enter keystore password: Re-enter new password: What is your first and last name?[Unknown]: localhost What is the name of your organizational unit?[Unknown]: MyDepartmentName What is the name of your organization?[Unknown]: MyCompanyName What is the name of your City or Locality?[Unknown]: Stafford What is the name of your State or Province?[Unknown]: NA What is the two-letter country code for this unit?[Unknown]: UK Is CNlocalhost, OUMyDepartmentName, OMyCompanyName, LStafford, STUK, CUK correct?[no]: YEnter key password for (RETURN if same as keystore password): 大多数字段是不言自明的。 但是对于名字和名字我通常使用机器名称–在这种情况下 localhost 更新Tomcat配置 保护您的应用程序的第二步是确保您的tomcat具有SSL连接器。 为此您需要找到tomcat的server.xml配置文件该文件通常位于conf目录中。 一旦掌握了这一点并且如果您使用的是tomcat那么就不用注释了 Connector port8443 protocolHTTP/1.1 SSLEnabledtruemaxThreads150 schemehttps securetrueclientAuthfalse sslProtocolTLS / …并使它看起来像这样 Connector SSLEnabledtrue keystoreFile/Users/Roger/tmp/roger.keystore keystorePasspassword port8443 schemehttps securetrue sslProtocolTLS/ 请注意密码“ password”是纯文本格式不是很安全。 有很多解决方法但这超出了本博客的范围。 如果您使用的是Spring的tcServer那么您会发现它已经具有配置如下的SSL连接器 Connector SSLEnabledtrue acceptCount100 connectionTimeout20000 executortomcatThreadPool keyAliastcserver keystoreFile${catalina.base}/conf/tcserver.keystore keystorePasschangeme maxKeepAliveRequests15 port${bio-ssl.https.port} protocolorg.apache.coyote.http11.Http11Protocol redirectPort${bio-ssl.https.port} schemehttps securetrue/ …在这种情况下只需编辑各个字段包括keyAliaskeystoreFile和keystorePass。 配置您的应用 如果现在启动tomcat并运行您的Web应用程序您现在会发现可以使用HTTPS访问它。 例如键入https://localhost:8443/my-app可以但是http://localhost:8080/my-app也可以。这意味着您还需要对应用程序进行一些jiggery-pokery以确保其成功仅响应HTTPS可以采用两种方法。 如果您不使用Spring Security则可以在最后一个web-app标签之前将以下内容添加到web.xml security-constraintweb-resource-collectionweb-resource-namemy-secure-app/web-resource-nameurl-pattern/*/url-pattern/web-resource-collectionuser-data-constrainttransport-guaranteeCONFIDENTIAL/transport-guarantee/user-data-constraint /security-constraint 如果您使用的是Spring Security那么还有更多步骤可以解决问题。 常规Spring Security设置的一部分是将以下内容添加到您的web.xml文件中。 首先您需要将一个Spring Security应用程序上下文文件添加到contextConfigLocation context-param context-paramparam-namecontextConfigLocation/param-nameparam-value/WEB-INF/spring/root-context.xml/WEB-INF/spring/appServlet/application-security.xml /param-value/context-param 其次您需要添加Spring Security filter和filter-mapping filterfilter-namespringSecurityFilterChain/filter-namefilter-classorg.springframework.web.filter.DelegatingFilterProxy/filter-class/filterfilter-mappingfilter-namespringSecurityFilterChain/filter-nameurl-pattern/*/url-pattern/filter-mapping 最后您需要创建或编辑application-security.xml 如以下非常简单的示例所示 ?xml version1.0 encodingUTF-8? beans:beans xmlnshttp://www.springframework.org/schema/securityxmlns:beanshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-3.0.xsdhttp://www.springframework.org/schema/securityhttp://www.springframework.org/schema/security/spring-security-3.1.xsdhttp auto-configtrue intercept-url pattern/** requires-channelhttps / /httpauthentication-manager/authentication-manager/beans:beans 在上面的示例中已经设置了intercept-url元素来拦截所有URL并强制它们使用https通道。 上面的配置详细信息可能给人的印象是使用简单的web.xml配置更改会更快但是如果您已经在使用Spring Security那么只需在现有配置中添加一个requires-channel属性即可。 可以在git hub上找到一个名为tomcat-ssl的示例应用程序用于演示上述内容网址为https://github.com/roghughe/captaindebug 参考 Captain Debug的Blog博客上的JCG合作伙伴 Roger Hughes 通过SSL和Spring Security保护Tomcat应用程序 。 翻译自: https://www.javacodegeeks.com/2012/12/securing-your-tomcat-app-with-ssl-and-spring-security.html
http://www.sadfv.cn/news/258517/

相关文章:

  • 梅州建站电话哪种语言做的网站好
  • 一个thinkphp搭建的微网站免费网站建设加盟
  • 找人做的网站怎么百度如何建网站群
  • 樟木头镇做网站网站免费模板资源
  • 公司做网站需要准备哪些资料仿制网站软件
  • 西安做网站魔盒网上商城图片
  • 专业 网站设计网络营销外包项目
  • 好看的企业官网图片式网站利于做优化吗
  • 建设电影网站需要多少钱做网站哪家好 青岛
  • 淘宝网站建设弄什么类目网站建设中涉及到的编程语言
  • 网站建设项目立项登记 表做百度推广是不是得有个网站先
  • 做网站哪些公司单位网站设计建议书
  • 仿站小工具wordpress网站挣钱怎么做
  • 昆明企业网站设计wordpress 菜单 页面跳转
  • 珠海网站建设怎么样建站运营新闻
  • 如何创建网站推广产品深圳自适应网站公司
  • 提供网站建设定制怎样在百度上建网站
  • 做网站公司是干什么的响应式网站优势
  • 创业服务网站建设方案项目书单位做网站注意什么问题
  • 北京网站建设公司东为网站价格明细表
  • 门户型网站有哪些网站建设程序编制
  • 网站建设哪些字体没有版权app定制开发公司哪家比较好
  • 广州市专业网站设计wordpress添加搜索插件
  • 如何做网站轮播图和菜单全屏安居客房产网
  • 建设部的官方网站京东物流网站建设特点
  • cms 网站后台内容管理系统模板产品价格的网站建设
  • wordpress发表评论项广州seo关键词优化外包
  • 做网站必须购买空间吗?大埔网站建设
  • 网站title的作用icp是什么
  • 定制网站开发泉州模板自助建站