Tomcat配置SSL证书

2023-10-27

本地配置ssl证书

为了更好的再服务器上配置ssl证书,先在本上上熟悉流程。本地不需要类似阿里云的证书,借助java的keytool帮助生成离线的证书。

keytool -genkey -alias ceshi -storetype PKCS12 -keyalg RSA -keystore D:\Java\apache-tomcat-9.0.55-windows-x64\apache-tomcat-9.0.55\conf\https.keystore

该命令会在指向的地址位置生成一个名为https.keystore的证书

在这里插入图片描述

进入该步骤后需要注意的密钥需要记住,之后还要用的,名字与姓氏要填域名即localhost其他的随便填即可。

如下在指定的目录下生成了证书:
在这里插入图片描述
配置证书加密访问,对于http协议来说,80是默认端口,若项目在其他端口上则需要带上端口号http://localhost:8080,对于https来说,443是默认端口号,若项目在其他端口上则也要带上端口号https://localhost:8443

接下来配置本地的https协议访问,已经生成了离线的证书,需要配置证书及监听的端口号,在server.xml文件中进行如下配置:

<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- Note:  A "Server" is not itself a "Container", so you may not
     define subcomponents such as "Valves" at this level.
     Documentation at /docs/config/server.html
 -->
<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <!-- Security listener. Documentation at /docs/config/listeners.html
  <Listener className="org.apache.catalina.security.SecurityListener" />
  -->
  <!-- APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

  <!-- Global JNDI resources
       Documentation at /docs/jndi-resources-howto.html
  -->
  <GlobalNamingResources>
    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
    -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <!-- A "Service" is a collection of one or more "Connectors" that share
       a single "Container" Note:  A "Service" is not itself a "Container",
       so you may not define subcomponents such as "Valves" at this level.
       Documentation at /docs/config/service.html
   -->
  <Service name="Catalina">

    <!--The connectors can use a shared executor, you can define one or more named thread pools-->
    <!--
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
        maxThreads="150" minSpareThreads="4"/>
    -->


    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" URIEncoding="UTF-8"/>


     
     <!--https测试-->
      <!-- certificateKeystoreFile 用于指定证书所在的目录 ;
 		certificateKeystorePassword 用于指定证书的密码;
		type是使用的加密算法-->
    <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
              maxThreads="150" schema="https" secure="true" SSLEnabled="true">
      <SSLHostConfig>
        <Certificate
          certificateKeystoreFile="conf/https.keystore" 
          certificateKeystorePassword="Xwh190823" type="RSA"
        />
      </SSLHostConfig>
    </Connector>


    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    -->
    <!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443
         This connector uses the NIO implementation. The default
         SSLImplementation will depend on the presence of the APR/native
         library and the useOpenSSL attribute of the
         AprLifecycleListener.
         Either JSSE or OpenSSL style configuration may be used regardless of
         the SSLImplementation selected. JSSE style configuration is used below.
    -->
    <!--
    <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
               maxThreads="150" SSLEnabled="true">
        <SSLHostConfig>
            <Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
                         type="RSA" />
        </SSLHostConfig>
    </Connector>
    -->
    <!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2
         This connector uses the APR/native implementation which always uses
         OpenSSL for TLS.
         Either JSSE or OpenSSL style configuration may be used. OpenSSL style
         configuration is used below.
    -->
    <!--
    <Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
               maxThreads="150" SSLEnabled="true" >
        <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
        <SSLHostConfig>
            <Certificate certificateKeyFile="conf/localhost-rsa-key.pem"
                         certificateFile="conf/localhost-rsa-cert.pem"
                         certificateChainFile="conf/localhost-rsa-chain.pem"
                         type="RSA" />
        </SSLHostConfig>
    </Connector>
    -->

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <!--
    <Connector protocol="AJP/1.3"
               address="::1"
               port="8009"
               redirectPort="8443" />
    -->

    <!-- An Engine represents the entry point (within Catalina) that processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request, and passes them
         on to the appropriate Host (virtual host).
         Documentation at /docs/config/engine.html -->

    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
    -->
    <Engine name="Catalina" defaultHost="localhost">

      <!--For clustering, please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) -->
      <!--
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      -->

      <!-- Use the LockOutRealm to prevent attempts to guess user passwords
           via a brute-force attack -->
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <!-- This Realm uses the UserDatabase configured in the global JNDI
             resources under the key "UserDatabase".  Any edits
             that are performed against this UserDatabase are immediately
             available for use by the Realm.  -->
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>

      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" -->
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

      </Host>
    </Engine>
  </Service>
</Server>

文件时全部的配置,来看https的部分:


     <!--https测试-->
      <!-- certificateKeystoreFile 用于指定证书所在的目录 ;
 		certificateKeystorePassword 用于指定证书的密码;
		type是使用的加密算法-->
    <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
              maxThreads="150" schema="https" secure="true" SSLEnabled="true">
      <SSLHostConfig>
        <Certificate
          certificateKeystoreFile="conf/https.keystore" 
          certificateKeystorePassword="123456" type="RSA"
        />
      </SSLHostConfig>
    </Connector>

监听的端口为8443,这个certificateKeystoreFile配置项填你生成证书的位置,certificateKeystorePassword这个填之前的密钥。就可以了!!!没错配置https就这么简单,只需要这就行就可以了,启动tomcat服务器即可。

keytool 错误: java.io.IOException: Invalid keystore format

在配置的过程中还遇到了一个问题keytool 错误: java.io.IOException: Invalid keystore format,出现这个问题的原因时jdk版本问题,不要使用高本版的jdk,用jdk8就可以了,在构建https.keystore是用的是jdk11导致tomcat一致报上面的错误,将jdk回退到jdk8之后就没问了。

配置完后进入bin目录开启tomcat服务器,通过http协议访问:http://localhost:8080

在这里插入图片描述

再通过https协议访问https://localhost:8443

在这里插入图片描述
如上图所示配置成功了,通过两个协议都可以访问。也可以进行其他的配置如修改为默认的端口号,这样就不需要每次添加端口号了,http协议是80,https协议是443。也可以配置跳转,将http协议访问的跳转到https协议上去即在web.xml配置文件中添加:

<security-constraint> 
    <web-resource-collection > 
        <web-resource-name >SSL</web-resource-name>  
        <url-pattern>/*</url-pattern> 
    </web-resource-collection> 
    <user-data-constraint> 
        <transport-guarantee>CONFIDENTIAL</transport-guarantee> 
    </user-data-constraint> 
</security-constraint>

添加上面内容就会实现实现HTTP自动跳转为HTTPS。甚至在跳转到一个项目上直接跳到网站首页也是可以的。

服务器上SSL证书配置

前面已经配置了本地即离线的SSL证书,那么该如何配置服务器上的SSL证书呢?道理和步骤和本地几乎是一样的。唯一不同的时外网的需要提供外网的SSL证书,可以在购买云服务器的网站免费下载证书,也可以通过第三方下载。不限于,华为云,阿里云,腾讯云等。

接下来以阿里云,云服务器内核为CentOS7为例,WEB服务器为Tomcat下载并配置SSL证书,来开放HTTPS协议访问。

SSL证书下载

下载好证书后是一个压缩包类型:

在这里插入图片描述
解压得到两个文件,一个是证书文件pfx类型,一个是密码txt类型:

在这里插入图片描述

和之前配置本地的方式一样主要就是配置https的证书,将解压的证书上传到服务的可见文件夹,记录该文件地址,配置server.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- Note:  A "Server" is not itself a "Container", so you may not
     define subcomponents such as "Valves" at this level.
     Documentation at /docs/config/server.html
 -->
<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <!-- Security listener. Documentation at /docs/config/listeners.html
  <Listener className="org.apache.catalina.security.SecurityListener" />
  -->
  <!-- APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

  <!-- Global JNDI resources
       Documentation at /docs/jndi-resources-howto.html
  -->
  <GlobalNamingResources>
    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
    -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <!-- A "Service" is a collection of one or more "Connectors" that share
       a single "Container" Note:  A "Service" is not itself a "Container",
       so you may not define subcomponents such as "Valves" at this level.
       Documentation at /docs/config/service.html
   -->
  <Service name="Catalina">

    <!--The connectors can use a shared executor, you can define one or more named thread pools-->
    <!--
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
        maxThreads="150" minSpareThreads="4"/>
    -->


    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" URIEncoding="UTF-8"/>


     
     <!--https测试-->
      <!-- certificateKeystoreFile 用于指定证书所在的目录 ;
 		certificateKeystorePassword 用于指定证书的密码;
		type是使用的加密算法-->
    <!-- <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
              maxThreads="150" schema="https" secure="true" SSLEnabled="true">
      <SSLHostConfig>
        <Certificate
          certificateKeystoreFile="cert/6340408_www.qiyuanrenli.com.pfx" 
          certificateKeystorePassword="zXOfVn8u" type="PKCS12"
        />
      </SSLHostConfig>
    </Connector> -->

    <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
           maxThreads="150" SSLEnabled="true">
    <SSLHostConfig>
        <Certificate certificateKeystoreFile="conf/cert/6340408_www.qiyuanrenli.com.pfx" 
                     certificateKeystoreType="PKCS12"
                     certificateKeystorePassword="zXOfVn8u" />
    </SSLHostConfig>
</Connector>


    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    -->
    <!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443
         This connector uses the NIO implementation. The default
         SSLImplementation will depend on the presence of the APR/native
         library and the useOpenSSL attribute of the
         AprLifecycleListener.
         Either JSSE or OpenSSL style configuration may be used regardless of
         the SSLImplementation selected. JSSE style configuration is used below.
    -->
    <!--
    <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
               maxThreads="150" SSLEnabled="true">
        <SSLHostConfig>
            <Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
                         type="RSA" />
        </SSLHostConfig>
    </Connector>
    -->
    <!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2
         This connector uses the APR/native implementation which always uses
         OpenSSL for TLS.
         Either JSSE or OpenSSL style configuration may be used. OpenSSL style
         configuration is used below.
    -->
    <!--
    <Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
               maxThreads="150" SSLEnabled="true" >
        <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
        <SSLHostConfig>
            <Certificate certificateKeyFile="conf/localhost-rsa-key.pem"
                         certificateFile="conf/localhost-rsa-cert.pem"
                         certificateChainFile="conf/localhost-rsa-chain.pem"
                         type="RSA" />
        </SSLHostConfig>
    </Connector>
    -->

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <!--
    <Connector protocol="AJP/1.3"
               address="::1"
               port="8009"
               redirectPort="8443" />
    -->

    <!-- An Engine represents the entry point (within Catalina) that processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request, and passes them
         on to the appropriate Host (virtual host).
         Documentation at /docs/config/engine.html -->

    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
    -->
    <Engine name="Catalina" defaultHost="localhost">

      <!--For clustering, please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) -->
      <!--
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      -->

      <!-- Use the LockOutRealm to prevent attempts to guess user passwords
           via a brute-force attack -->
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <!-- This Realm uses the UserDatabase configured in the global JNDI
             resources under the key "UserDatabase".  Any edits
             that are performed against this UserDatabase are immediately
             available for use by the Realm.  -->
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>

      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" -->
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

      </Host>
    </Engine>
  </Service>
</Server>

同样的核心配置就这几行:


<!--https  SSL证书-->

    <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
           maxThreads="150" SSLEnabled="true">
    <SSLHostConfig>
        <Certificate certificateKeystoreFile="conf/cert/6340408.pfx" 
                     certificateKeystoreType="PKCS12"
                     certificateKeystorePassword="-----" />
    </SSLHostConfig>
</Connector>

certificateKeystoreFile是上传的证书所在的位置,certificateKeystoreType是证书的类型,不是所有证书都是fpx类型,也要适当更改例如还有RSA类型。certificateKeystorePassword是证书密钥,打开下载的哪个txt文档就可以看见密钥。

配置完成后重启Tomcat服务器即可。成功的HTTP和HTTPS都可以访问。

在这里插入图片描述

在这里插入图片描述

如果HTTPS配置了还能访问的话分析错误的原因:

  1. 该网站为提供安全连接

如果浏览器出现该情况的大概率就是证书配置有问题,检查一下是否有配置错误的问题。

  1. 无法访问此网页

浏览器出现该提示,首先检查域名或ip是否正确,然后是端口号,http协议的tomcat默认是8080,https协议在配置时监听的端口时8443。

3.服务器未响应

浏览器出现这个提示时,可能时服务上的服务未启动、端口被占用、或者是防火墙未开放端口,需要去云服务器的安全组开放端口。

最后要注意的是端口问题,如果安装了防火墙工具的话要开启用到的端口,云服务器去安全组开放端口,安装了宝塔的也要开启端口。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Tomcat配置SSL证书 的相关文章

随机推荐

  • VSCode格式化XML

    VSCode格式化XML 文章目录 VSCode格式化XML 1 结果展示 2 插件 notepad 自带的xml插件不是很好用 显示xml树的插件经常失灵 尝试在VSCode上找到了一些插件 很好的解决了XML的格式化和XML节点显示的问
  • 【华为OD机试真题 Python】数组二叉树

    前言 本专栏将持续更新华为OD机试题目 并进行详细的分析与解答 包含完整的代码实现 希望可以帮助到正在努力的你 关于OD机试流程 面经 面试指导等 如有任何疑问 欢迎联系我 wechat steven moda email nansun09
  • HashMap底层原理分析(结合面试问题分析)

    1 为什么HashMap底层数组的容量总是2的幂次方 答 因为hashmap的底层在计算一个entry存放在数组中的索引值的时候 采用哈希值运算 如果经过哈希算法得到的一个哈希值h的后面的二进制表示为 0101 0101 此时的数组的长度l
  • 软件构造总结笔记

    软件构造总结笔记 本笔记依据考试大纲 调整课堂讲义的分点 以知识点分化作为条理 精简原本人课堂笔记 进行总结 GitHub仓库资源 gzn00417 2020Spring Software Construction 文章目录 软件构造总结笔
  • 记一次某src得子域名接管漏洞挖掘

    如下案例是fofa找的 在火线资产里直接搜索关键词html noSuchbucket 可以看到显示如下信息
  • 无损剪切音视频文件的跨平台工具: LosslessCut

    mifi lossless cut Stars 17 3k License GPL 2 0 LosslessCut是一款跨平台的FFmpeg GUI工具 它可以对视频 音频和字幕等相关媒体文件进行快速无损操作 该软件最主要的功能是无损剪切和
  • 初识网络原理

    确定不来看看新出炉的知识 目录 1 网络互连 1 1局域网 1 2广域网 2 网络通信基础 2 1IP地址 2 2端口号 3 认识协议 3 1五元组 3 2协议分层 3 3OSI 7层模型 3 4TCP IP5层 或5层 模型 3 5网络设
  • 请求参数默认值多种实现方式

    文章目录 1 直接赋值 2 使用切面实现默认值 自定义注解 切面类 控制层使用 效果展示 3 使用过滤器Filter实现 自定义请求体 自定义过滤器 1 直接赋值 当前页码 private int pageNum 1 每页条数 privat
  • idea快速清理无效类文件

    1 右击选中的项目 如下图所示 2 在弹出框中输入 unused declaration点击选择 如下图所示 3 弹出如下图所示 点击ok 此时需要一段时间 4 结果如下图所示 5 此时 一个个选中 然后双击 有4种处理模式 如下图所示 S
  • 基于Distflow的最优潮流模型(OPF)--模型推导篇

    开篇 前言 自打上期内容火电机组经济调度建模及求解 基础篇推出以后 有小伙伴留言 不考虑潮流问题的经济调度都是耍流氓 作为一个有文化的流氓 我们尝试着为大家科普潮流计算 对于电力系统而言 潮流计算是一个非常复杂且重要内容 如果我们推文中有什
  • 俞敏洪:与其有钱,不如值钱

    很多人一辈子有两个追求 一个是有钱 一个是值钱 有的人运气好 出生在富贵之家 一出生就像贾宝玉一样嘴里含着玉 有钱就不是问题 但有钱解决不了第二个问题 也就是你本人值不值钱的问题 值钱是个人价值的体现 比如你去找一份工作 人家给你开出百万年
  • 链表 List.h

    链表 List h include list h include
  • Android指纹门锁ESP32项目

    本教程中我向您展示如何使用指纹扫描仪Android手机通过ESP32或ESP8266 Wifi或Arduino wifi模块进行门解锁 要创建此项目 您需要ESP32 中继模块 电磁门锁和Android手机 所需零件 源代码 详情参阅 亚图
  • layUI 使用select选择框无法显示出样式,看不到、等解决方案

    我们在写layui代码时候可能遇到这样的问题 明明代码都是从layui官网上复制下来的 却还是会看不到相应的元素 就比如我昨天遇到的一个BUG 代码如上 但是页面上却没有显示出选择框 选择框这里却依然没有结果出现 这个问题困扰了我几个小时
  • js下载base64格式的图片

    步骤 1 创建一个a标签 2 给a标签创建点击事件 3 将base64数据转为Blob类型 4 将a标签的href指向Blob类型数据 5 触发a标签 代码 template vue qr 组件可以自动将 text绑定的url地址转换为二维
  • 【Python零基础入门篇 · 9】:字典的相关操作

    文章目录 字典 键 值 字典的基本格式 字典的定义 键值对 键的唯一性 字典的常见操作一 增删改查 查看元素 根据键名返回值 删除元素 del clear 修改元素 添加元素 字典中的常见操作二 len 求长度 dict keys dict
  • SQL语句:查询数据表的前n行信息

    每种数据库使用的关键字都不一样 每种数据库使用的关键字都不一样 每种数据库使用的关键字都不一样 SQL Server MS Access 语法 TOP SELECT TOP number percent column name s FROM
  • Java 模拟百度翻译

    相信百度翻译对于大家来说并不陌生 本案例要求编写一个程序模拟百度翻译 用户输入英文之后搜索程序中对应的中文 如果搜索到对应的中文就输出搜索结果 反之给出提示 package demo52 import java util HashMap i
  • sv面向对象:类

    写在前面 开始修炼 类是通过代码怎么体现 实例1 定义一个类 systemverilog绿皮书 例5 1简单的 Transaction类 class Transaction bit 31 0 addr crc data 8 class pr
  • Tomcat配置SSL证书

    本地配置ssl证书 为了更好的再服务器上配置ssl证书 先在本上上熟悉流程 本地不需要类似阿里云的证书 借助java的keytool帮助生成离线的证书 keytool genkey alias ceshi storetype PKCS12