Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏

第 24 章 Spring boot with Container

目录

24.1. Spring boot with Docker
24.1.1. 通过 Docker 命令构建镜像
24.1.2. 通过 Maven 构建 Docker 镜像
24.1.3. [ERROR] No plugin found for prefix 'dockerfile' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/Users/neo/.m2/repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
24.1.4. curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to localhost:8888
24.2. Spring boot with Docker stack
24.2.1. 编译 Docker 镜像
24.2.2.
24.3. Spring boot with Kubernetes
24.3.1. Kubernetes 编排脚本
24.3.2. 部署镜像

24.1. Spring boot with Docker

24.1.1. 通过 Docker 命令构建镜像

手工编译镜像

在项目根目录创建 Dockerfile 文件

		
% cat Dockerfile 
FROM openjdk
VOLUME /tmp
COPY target/*.jar app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]		
		
				

编译镜像

		
mvn package
docker build -t netkiller/docker .
 
% docker images | grep netkiller
netkiller/docker                           latest              ed359b6ffcad        16 seconds ago      105MB 

% docker run -ti --entrypoint /bin/sh netkiller/docker
sh-4.2# ls
app.jar  bin  boot  dev  etc  home  lib  lib64	media  mnt  opt  proc  root  run  sbin	srv  sys  tmp  usr  var
sh-4.2# 
		
				

启动镜像测试

		
docker run -p 8080:8080 netkiller/docker

neo@MacBook-Pro ~ % curl http://localhost:8080
Hello Docker World
		
				
Dockerfile 放在 src/main/docker/Dockerfile 下
		
% cat src/main/docker/Dockerfile 
FROM openjdk
VOLUME /tmp
COPY target/*.jar app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
		
				
		
mvn package
docker rmi netkiller/docker -f
docker build -t netkiller/docker -f src/main/docker/Dockerfile .
docker run -p 8080:8080 netkiller/docker
		
				
		
neo@MacBook-Pro ~ % curl http://localhost:8080
Hello Docker World
		
				
通过参数指定 Springboot 文件
		
% cat src/main/docker/Dockerfile 
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
		
				

		
mvn package
docker rmi netkiller/docker -f
docker build --build-arg JAR_FILE=target/*.jar -t netkiller/docker -f src/main/docker/Dockerfile .
docker run -p 8080:8080 netkiller/docker
		
				
SPRING_PROFILES_ACTIVE 指定配置文件
		
% docker run -e "SPRING_PROFILES_ACTIVE=prod" -p 8080:8080 netkiller/docker
		
				
推送镜像到仓库
		
neo@MacBook-Pro ~ % docker push netkiller/docker
The push refers to repository [docker.io/netkiller/docker]
100ff47f36fe: Pushed 
a7aafc769de1: Mounted from library/openjdk 
2666aafcfdd9: Mounted from library/openjdk 
c4a7cf6a6169: Mounted from library/openjdk 

latest: digest: sha256:3078fea95c633f007be33b829efae0ff8e9d78ad463925af7d07752c95eb43a3 size: 1165
		
				

24.1.2. 通过 Maven 构建 Docker 镜像

Maven + Dockerfile 方案一

项目地址 https://github.com/spotify/dockerfile-maven

		
	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<configuration>
					<mainClass>cn.netkiller.docker.Application</mainClass>
				</configuration>
			</plugin>
			<plugin>
				<groupId>com.spotify</groupId>
				<artifactId>dockerfile-maven-plugin</artifactId>
				<version>1.4.10</version>
				<executions>
					<execution>
						<id>default</id>
						<goals>
							<goal>build</goal>
							<goal>push</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<dockerfile>${project.basedir}/src/main/docker/Dockerfile</dockerfile>
					<repository>${docker.image.prefix}/${project.artifactId}</repository>
					<tag>${project.version}</tag>
					<buildArgs>
						<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
					</buildArgs>
					<resources>
						<resource>
							<targetPath>/</targetPath>
							<directory>${project.build.directory}</directory>
							<include>${project.build.finalName}.jar</include>
						</resource>
					</resources>

				</configuration>

			</plugin>
		</plugins>
	</build>
	
		
				
		
neo@MacBook-Pro ~/git/springcloud/docker % mvn dockerfile:build
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------< cn.netkiller:docker >-------------------------
[INFO] Building docker 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- dockerfile-maven-plugin:1.4.10:build (default-cli) @ docker ---
[INFO] dockerfile: /Users/neo/git/springcloud/docker/src/main/docker/Dockerfile
[INFO] contextDirectory: /Users/neo/git/springcloud/docker
[INFO] Building Docker context /Users/neo/git/springcloud/docker
[INFO] Path(dockerfile): /Users/neo/git/springcloud/docker/src/main/docker/Dockerfile
[INFO] Path(contextDirectory): /Users/neo/git/springcloud/docker
[INFO] 
[INFO] Image will be built as netkiller/docker:0.0.1-SNAPSHOT
[INFO] 
[INFO] Step 1/7 : FROM openjdk
[INFO] 
[INFO] Pulling from library/openjdk
[INFO] Digest: sha256:38ec2c78a60ec4d5773c93534e433237be154ff5afa476965a68837b43ef2f19
[INFO] Status: Image is up to date for openjdk:latest
[INFO]  ---> b697a97ee8e1
[INFO] Step 2/7 : MAINTAINER Netkiller <netkiller@msn.com>
[INFO] 
[INFO]  ---> Using cache
[INFO]  ---> e6fd68ec1ce8
[INFO] Step 3/7 : VOLUME /tmp
[INFO] 
[INFO]  ---> Using cache
[INFO]  ---> 78b146e1a8a0
[INFO] Step 4/7 : ARG JAR_FILE
[INFO] 
[INFO]  ---> Using cache
[INFO]  ---> 2c60b65d49dc
[INFO] Step 5/7 : COPY ${JAR_FILE} app.jar
[INFO] 
[INFO]  ---> Using cache
[INFO]  ---> 3186f0425f1d
[INFO] Step 6/7 : CMD ["java", "-version"]
[INFO] 
[INFO]  ---> Using cache
[INFO]  ---> d14b8d6360fe
[INFO] Step 7/7 : ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
[INFO] 
[INFO]  ---> Using cache
[INFO]  ---> 68e424cf5eab
[INFO] Successfully built 68e424cf5eab
[INFO] Successfully tagged netkiller/docker:0.0.1-SNAPSHOT
[INFO] 
[INFO] Detected build of image with id 68e424cf5eab
[INFO] Building jar: /Users/neo/git/springcloud/docker/target/docker-0.0.1-SNAPSHOT-docker-info.jar
[INFO] Successfully built netkiller/docker:0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  9.413 s
[INFO] Finished at: 2019-04-13T05:39:07+08:00
[INFO] ------------------------------------------------------------------------

		
				
Maven + Dockerfile 方案二
			
<build>
  <plugins>
    ...
    <plugin>
      <groupId>com.spotify</groupId>
      <artifactId>docker-maven-plugin</artifactId>
      <version>VERSION GOES HERE</version>
      <configuration>
        <imageName>example</imageName>
        <dockerDirectory>docker</dockerDirectory>
        <resources>
           <resource>
             <targetPath>/</targetPath>
             <directory>${project.build.directory}</directory>
             <include>${project.build.finalName}.jar</include>
           </resource>
        </resources>
      </configuration>
    </plugin>
    ...
  </plugins>
</build>			
			
				
Maven 不使用 Dockerfile 文件

项目地址 https://github.com/spotify/docker-maven-plugin

		
			<plugin>
				<groupId>com.spotify</groupId>
				<artifactId>docker-maven-plugin</artifactId>
				<version>1.2.0</version>
				<configuration>
					<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
					<baseImage>openjdk</baseImage>
					<tag>${project.version}</tag>
					<maintainer>${docker.maintainer}</maintainer>
					<volumes>/tmp</volumes>
					<workdir>/</workdir>
					<cmd>["java", "-version"]</cmd>
					<entryPoint>["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "/${project.build.finalName}.jar"]</entryPoint>
					<!-- copy the service's jar file from target into the root directory of the image -->
					<resources>
						<resource>
							<targetPath>/</targetPath>
							<directory>${project.build.directory}</directory>
							<include>${project.build.finalName}.jar</include>
						</resource>
					</resources>
				</configuration>
			</plugin>
		
				

构建镜像 mvn clean package docker:build

		
neo@MacBook-Pro ~/git/springcloud/webflux % mvn docker:build         
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------< cn.netkiller:webflux >------------------------
[INFO] Building webflux 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- docker-maven-plugin:1.2.0:build (default-cli) @ webflux ---
[INFO] Using authentication suppliers: [ConfigFileRegistryAuthSupplier]
[INFO] Copying /Users/neo/git/springcloud/webflux/target/webflux-0.0.1-SNAPSHOT.jar -> /Users/neo/git/springcloud/webflux/target/docker/webflux-0.0.1-SNAPSHOT.jar
[INFO] Building image netkiller/webflux
Step 1/7 : FROM openjdk

 ---> b697a97ee8e1
Step 2/7 : MAINTAINER netkiller

 ---> Using cache
 ---> c275f5dc2815
Step 3/7 : WORKDIR /

 ---> Using cache
 ---> 27815e0b4455
Step 4/7 : ADD /webflux-0.0.1-SNAPSHOT.jar //

 ---> Using cache
 ---> 78b0fe2a827d
Step 5/7 : ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "/webflux-0.0.1-SNAPSHOT.jar"]

 ---> Using cache
 ---> 66d5499c8ba3
Step 6/7 : CMD ["java", "-version"]

 ---> Using cache
 ---> 080a1468d88b
Step 7/7 : VOLUME /tmp

 ---> Using cache
 ---> 60debfac7b7c
ProgressMessage{id=null, status=null, stream=null, error=null, progress=null, progressDetail=null}
Successfully built 60debfac7b7c
Successfully tagged netkiller/webflux:latest
[INFO] Built netkiller/webflux
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.485 s
[INFO] Finished at: 2019-04-13T05:41:41+08:00
[INFO] ------------------------------------------------------------------------
		
				
推送镜像
			
neo@MacBook-Pro ~ % vim /usr/local/Cellar/maven/3.6.0/libexec/conf/settings.xml
			
  <!-- servers
   | This is a list of authentication profiles, keyed by the server-id used within the system.
   | Authentication profiles can be used whenever maven must make a connection to a remote server.
   |-->
  <servers>
    <!-- server
     | Specifies the authentication information to use when connecting to a particular server, identified by
     | a unique name within the system (referred to by the 'id' attribute below).
     |
     | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
     |       used together.
     |
    <server>
      <id>deploymentRepo</id>
      <username>repouser</username>
      <password>repopwd</password>
    </server>
    -->

    <!-- Another sample, using keys to authenticate.
    <server>
      <id>siteServer</id>
      <privateKey>/path/to/private/key</privateKey>
      <passphrase>optional; leave empty if not used.</passphrase>
    </server>
    -->
    <server>
      <id>docker-hub</id>
      <username>netkiller</username>
      <password>******</password>
      <configuration>
        <email>netkiller@msn.com</email>
      </configuration>
    </server>
  </servers>			
			
				

****** 修改为你的密码

查看 Docker Registry 地址

			
neo@MacBook-Pro ~ % docker info | grep Registry
Registry: https://index.docker.io/v1/			
			
				

maven docker 插件配置

			
			<plugin>
				<groupId>com.spotify</groupId>
				<artifactId>docker-maven-plugin</artifactId>
				<version>1.2.0</version>
				<configuration>
					<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
					<baseImage>openjdk</baseImage>
					<tag>${project.version}</tag>
					<maintainer>${docker.maintainer}</maintainer>
					<volumes>/tmp</volumes>
					<workdir>/srv</workdir>
					<cmd>["java", "-version"]</cmd>
					<entryPoint>["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "/srv/${project.build.finalName}.jar"]</entryPoint>
					<!-- copy the service's jar file from target into the root directory of the image -->
					<resources>
						<resource>
							<targetPath>/</targetPath>
							<directory>${project.build.directory}</directory>
							<include>${project.build.finalName}.jar</include>
						</resource>
					</resources>
					<image>${docker.image.prefix}/${project.artifactId}</image>
					<newName>${docker.image.prefix}/${project.artifactId}:${project.version}</newName>
					<serverId>docker-hub</serverId>
					<registryUrl>https://index.docker.io/v1/</registryUrl>
				</configuration>
			</plugin>			
			
				
			
docker:build -DpushImage or docker:push			
			
				

使用加密的密码

			
neo@MacBook-Pro ~ % mvn --encrypt-master-password 
Master password: 
{r7kkN/XCOXYHqwRqE30k6Bz+pNGsB7/UogGTqqo+G2A=}
			
				
			
vim /usr/local/Cellar/maven/3.6.0/libexec/conf/settings.xml
			
<servers>
  <server>
    <id>docker-hub</id>
    <username>netkiller</username>
    <password>{r7kkN/XCOXYHqwRqE30k6Bz+pNGsB7/UogGTqqo+G2A=}</password>
  </server>
</servers>			
			
				

			
vim ~/.m2/settings-security.xml

<settingsSecurity>
  <master>{r7kkN/XCOXYHqwRqE30k6Bz+pNGsB7/UogGTqqo+G2A=}</master>
</settingsSecurity>			
			
				

24.1.3. [ERROR] No plugin found for prefix 'dockerfile' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/Users/neo/.m2/repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]

		
在maven的conf/setting.xml中要加入:

neo@MacBook-Pro ~ % mvn -version
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-25T02:41:47+08:00)
Maven home: /usr/local/Cellar/maven/3.6.0/libexec
Java version: 12, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-12.jdk/Contents/Home
Default locale: en_CN, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.5", arch: "x86_64", family: "mac"


vim /usr/local/Cellar/maven/3.6.0/libexec/conf/settings.xml

<pluginGroups>  
    <pluginGroup>com.spotify</pluginGroup>  
</pluginGroups>
		
			

24.1.4. curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to localhost:8888

		
iMac:config neo$ curl -k -i -H HOST:sss https://config:s3cr3t@localhost:8888/netkiller-dev.json
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to localhost:8888		
		
			

检查发现 8888 端口已经启动,SSL证书读不到

		
iMac:config neo$ openssl s_client -connect localhost:8888 
CONNECTED(00000005)
140735970464712:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:/BuildRoot/Library/Caches/com.apple.xbs/Sources/libressl/libressl-22.50.3/libressl/ssl/s23_lib.c:124:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 318 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
---		
		
			

我开始怀疑是泛域名问题

		
keytool -genkey -alias *.netkiller.cn -storetype PKCS12 -keyalg RSA -keysize 2048 -storepass passw0rd -keystore allhost.p12 -dname "CN=*.netkiller.cn, OU=netkiller, O=netkiller.cn, L=Guangdong, ST=Shenzhen, C=CN"
keytool -selfcert -alias *.netkiller.cn -storepass passw0rd -keystore allhost.p12		
		
			

测试后发现跟证书无关。

经过曲折的排查发现绑定了地址,在本地启动是正常的,一旦放入 Docker 容器就无法工作。

		
#server.address=localhost
server.port=8888

server.ssl.enabled=true
server.ssl.key-store-type=PKCS12
server.ssl.key-store=classpath:localhost.p12
server.ssl.key-store-password=123456
#server.ssl.key-store=classpath:allhost.p12
#server.ssl.key-store-password=passw0rd
server.http2.enabled=true

#logging.file=target/spring.log

spring.application.name=config-server
spring.profiles.active=native
spring.security.user.name=config
spring.security.user.password=s3cr3t

#spring.cloud.config.server.git.uri=/opt/config
spring.cloud.config.server.native.search-locations=classpath:/shared		
		
			

去掉 server.address=localhost 即可,在 build docker 镜像,然后启动容器。可以正常获取证书

		
iMac:config neo$ openssl s_client -connect localhost:8888 
CONNECTED(00000005)
depth=0 C = CN, ST = Shenzhen, L = Guangdong, O = netkiller.cn, OU = netkiller, CN = localhost
verify error:num=18:self signed certificate
verify return:1
depth=0 C = CN, ST = Shenzhen, L = Guangdong, O = netkiller.cn, OU = netkiller, CN = localhost
verify return:1
---
Certificate chain
 0 s:/C=CN/ST=Shenzhen/L=Guangdong/O=netkiller.cn/OU=netkiller/CN=localhost
   i:/C=CN/ST=Shenzhen/L=Guangdong/O=netkiller.cn/OU=netkiller/CN=localhost
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIDijCCAnKgAwIBAgIJAP/SjXit0rVsMA0GCSqGSIb3DQEBCwUAMHMxCzAJBgNV
BAYTAkNOMREwDwYDVQQIEwhTaGVuemhlbjESMBAGA1UEBxMJR3Vhbmdkb25nMRUw
EwYDVQQKEwxuZXRraWxsZXIuY24xEjAQBgNVBAsTCW5ldGtpbGxlcjESMBAGA1UE
AxMJbG9jYWxob3N0MB4XDTIwMDkwNzA4NTUzOVoXDTIwMTIwNjA4NTUzOVowczEL
MAkGA1UEBhMCQ04xETAPBgNVBAgTCFNoZW56aGVuMRIwEAYDVQQHEwlHdWFuZ2Rv
bmcxFTATBgNVBAoTDG5ldGtpbGxlci5jbjESMBAGA1UECxMJbmV0a2lsbGVyMRIw
EAYDVQQDEwlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
AQCTZUtf/siYQr3MBstphQsBceRxvflDm2C4ztZ8OemDzH2avhI7edD6rzrJQ0V2
1n1XlTRgwoYqoTgeIdQ1DbzgrCliBYy+3E9vcp8WWzYz9o2YZRphYUr37iWonP+b
ZkLqzmRLuASRNZ8sBrwD7Mvs5IXfJZQ8wruO0V4oJQ5NOzcxDmbA0WGJn/0QZDKN
/tR7Rw3g9B96fFYGI/T7g4nuteEiUqQ9GJ1gx3utBd31Z1m8cV59ZsWd+Y2P14LO
W+YxkpB56OZKWWr1ExxQdZmLIME+D0d40M8At6rCAvclMKa7dva6+ZRxPlizVkQS
L4JNT1WOMtVaUUhFX5xlhsBtAgMBAAGjITAfMB0GA1UdDgQWBBROMJrswZ37wsxV
sm0N9AHOE8ZiODANBgkqhkiG9w0BAQsFAAOCAQEAPIgc6ZcQueQTEym36gx2IRWT
wLVQEabyS4/xeu89aRfbGDOavBajNwStqGdWUE8PRb95bhfvziZ61c6gBO9IE23j
GOmIQTW5RvZL6HLJgqR3LngZUiV/Ugwuno5Uo8IN25duq993tNmdCG8YeBtfuy/j
OFRrn96OT/Trj04NfYmC7nqBThyNmLPY5Oeo0XkhIAqqcLJE8/SJ9zd16vmgVhPM
UlsFJcZoL1uhbNXQuLPv8id8tntH+Lli39RVwd56CgTW7k9YFfFNV0mCeWBsAYl3
74R8l4ClV15o31wH/qPLg0F6uE/M/xsz56WIu2e5Oa30issz0DjYrG9GiQ2kDA==
-----END CERTIFICATE-----
subject=/C=CN/ST=Shenzhen/L=Guangdong/O=netkiller.cn/OU=netkiller/CN=localhost
issuer=/C=CN/ST=Shenzhen/L=Guangdong/O=netkiller.cn/OU=netkiller/CN=localhost
---
No client certificate CA names sent
---
SSL handshake has read 2631 bytes and written 512 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-GCM-SHA384
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES256-GCM-SHA384
    Session-ID: 856BA1E0CFE8AC65AEC838C0A4DA0503C7A05F0BA803B127D3B1EBBB8FF1A344
    Session-ID-ctx: 
    Master-Key: 2DCA2747330C8008958B1A4F3EF340044FE69455EA730DA0E30DF97A13E6EB7BCABDFDF5CA0FA5B278701EA25D694CAB
    TLS session ticket lifetime hint: 86400 (seconds)
    TLS session ticket:
    0000 - 93 c1 d2 63 4d ef 37 a9-47 d1 72 2e ee 07 5a e2   ...cM.7.G.r...Z.
    0010 - b7 40 aa 89 db 70 64 88-86 ad 65 2e e9 f8 2a de   .@...pd...e...*.
    0020 - 02 03 7f d3 5d 22 c2 e1-48 5a 43 59 7d 0f ef cc   ....]"..HZCY}...
    0030 - cc fa 08 f9 bd 23 70 bb-82 8b d8 29 c8 42 e8 ed   .....#p....).B..
    0040 - 12 6d ae 99 c8 74 c0 87-d9 a0 c0 27 ae 92 d9 71   .m...t.....'...q
    0050 - ab 14 da d1 c6 9f 6f ba-7b 2f 6a 39 af c3 81 09   ......o.{/j9....
    0060 - bd 8a ac 55 d0 9f e4 32-d7 a6 1f 10 29 0d 07 f0   ...U...2....)...
    0070 - 09 d2 54 35 a8 d5 9e 9c-e1 5b 7b dd cc de eb 2a   ..T5.....[{....*
    0080 - 94 f9 56 41 df 14 85 37-b3 c1 28 be fe 1b ae 64   ..VA...7..(....d
    0090 - 68 c9 b3 12 8b 78 28 d4-16 f3 28 3e 0e c3 e2 e3   h....x(...(>....
    00a0 - 0d d5 42 46 37 3a 62 11-38 d4 68 59 77 01 2f 12   ..BF7:b.8.hYw./.
    00b0 - 29 b1 3f ab 3d c2 0b be-f0 df 87 43 ae 89 99 35   ).?.=......C...5
    00c0 - 19 eb fc 00 38 fa cc 5e-bb 0c 81 7f ae ee 8f 0e   ....8..^........
    00d0 - c5 82 00 4f bc f4 c6 a7-b0 3e 27 a8 0a 7e 57 a0   ...O.....>'..~W.
    00e0 - b8 c9 4a 04 49 61 db 62-cd bc a2 3d c4 32 a0 74   ..J.Ia.b...=.2.t
    00f0 - 11 0a ee c0 99 58 7a ce-99 30 7f a2 90 a0 50 30   .....Xz..0....P0
    0100 - fe df 5e 57 d5 e3 fb 6f-20 64 eb 8e ef da 95 6b   ..^W...o d.....k
    0110 - 5c 20 38 62 75 5b d0 b6-4a 38 12 4b 8e be 6c 03   \ 8bu[..J8.K..l.
    0120 - 14 b1 e9 05 cf b7 8c 12-e4 b6 2e 84 c3 14 57 4b   ..............WK
    0130 - 56 a6 47 f6 2f 06 81 12-a5 d8 88 8e 2f dd 40 43   V.G./......./.@C
    0140 - 31 c3 0b 85 7d 26 ef b2-4d 9d aa 40 f4 e4 1c bd   1...}&..M..@....
    0150 - 03 8e 61 b6 da d0 05 49-32 7a 26 44 7c 8e 69 c5   ..a....I2z&D|.i.
    0160 - 9c 41 30 e3 0f 08 8f 57-1e 70 13 ff c2 cc f2 53   .A0....W.p.....S
    0170 - 44 ed d2 9f c0 1c 5a 49-1a e3 88 94 84 15 7d c1   D.....ZI......}.
    0180 - a7 e5 fc 39 70 92 c1 6f-77 64 dc 93 aa af 81 ad   ...9p..owd......
    0190 - 64 50 c6 f9 3e da 4f 62-60 21 df 78 98 ca 78 6e   dP..>.Ob`!.x..xn
    01a0 - d0 43 14 12 54 ae 4b e0-f4 4b 70 06 1e 26 6a 17   .C..T.K..Kp..&j.
    01b0 - af b2 7c 76 75 ce 4f 60-79 5d a8 4d 8f e7 22 75   ..|vu.O`y].M.."u
    01c0 - 5b 65 db 42 5e b5 c0 05-9e ef f1 38 e4 e8 b0 a2   [e.B^......8....
    01d0 - 89 60 fa 43 18 e3 89 e9-4d d2 52 87 8c a3 73 16   .`.C....M.R...s.
    01e0 - f6 9b d4 0f 72 b3 22 e1-86 87 b1 85 c4 b0 b6 36   ....r."........6
    01f0 - 1f 83 1f 87 76 28 20 9f-64 ca f0 1e 11 da 0b bf   ....v( .d.......
    0200 - 75 df a9 77 48 84 6d a1-5e 2d 3c f7 d6 df 3e d8   u..wH.m.^-<...>.
    0210 - 6e 18 6f 53 eb c1 86 9e-cb a8 e1 19 e7 f4 5c b9   n.oS..........\.
    0220 - 58 c9 d4 38 b1 4a 3b ff-a0 16 34 2f 69 67 28 b4   X..8.J;...4/ig(.
    0230 - e9 72 f8 97 75 6d a0 15-5c 16 cf 28 33 2f c1 37   .r..um..\..(3/.7
    0240 - ca 09 07 2b 5f 5f e7 6b-94 19 9c 95 5c 2c d1 54   ...+__.k....\,.T
    0250 - 69 3f cd d5 63 9f 75 6c-26 53 cd 57 3a 9b 7b 02   i?..c.ul&S.W:.{.
    0260 - 6e 79 5c e5 36 9d 90 1a-d2 8a 0b b2 6f 03 5a fd   ny\.6.......o.Z.
    0270 - b0 3b d1 b8 68 be 1f 99-05 e2 52 a5 96 99 bd bf   .;..h.....R.....
    0280 - bd 84 06 b9 ed fb bb 2e-fd 9b 14 1b ca 7c 07 eb   .............|..
    0290 - a6 ff 07 ce d3 6b 48 26-b2 f0 67 c2 96 6d 4b 00   .....kH&..g..mK.
    02a0 - 77 d3 59 e0 fc 48 19 29-23 1a 9a 30 b6 3f 2a 12   w.Y..H.)#..0.?*.
    02b0 - 80 b4 f7 5e 33 85 42 da-c2 b9 42 dd 30 73 f1 15   ...^3.B...B.0s..
    02c0 - f2 16 49 f7 24 39 77 61-e4 90 7c 32 f1 e9 0e fb   ..I.$9wa..|2....
    02d0 - 7b a7 02 db 91 3a 16 8c-85 d2 2a 38 ad 3c a8 a9   {....:....*8.<..
    02e0 - 0b a8 3f 5b 49 92 de 45-41 74 60 dd 41 66 8f ac   ..?[I..EAt`.Af..
    02f0 - d2 23 60 25 99 6f 73 8b-8c f1 88 6c 67 36 b7 e0   .#`%.os....lg6..
    0300 - 60 d1 2a 77 b4 3e 29 bb-90 dc 7f f2 30 2e e7 de   `.*w.>).....0...
    0310 - dd 48 f6 dc 59 30 89 fe-1f 90 ac a6 10 42 96 ab   .H..Y0.......B..
    0320 - a7 84 34 2c 2e 54 d1 1b-65 48 a9 47 63 3f ff 2a   ..4,.T..eH.Gc?.*
    0330 - a1 66 b7 6d d6 f7 d3 11-d3 6a 21 33 a4 99 5c a4   .f.m.....j!3..\.
    0340 - e3 a1 b8 5a 1b 7a d9 45-89 fa 12 ee 5f 5b 69 6e   ...Z.z.E...._[in
    0350 - 7b 77 ba c9 3a 3c 09 b0-db 16 ad ac 66 6e 36 5a   {w..:<......fn6Z
    0360 - 48 c9 9a e7 6c a7 2f 10-31 33 9c 3f e1 18 9c af   H...l./.13.?....
    0370 - dc a1 f9 26 50 2a 66 e8-62 da fb 51 ad dc d6 72   ...&P*f.b..Q...r
    0380 - ca 53 4c 7b 72 e6 2b ee-f9 fd 97 f3 c4 67 dc c6   .SL{r.+......g..
    0390 - f1 38 d1 58 d5 df 02 a5-1c f0 3d 5b 6d 01 be ff   .8.X......=[m...
    03a0 - a7 d1 0b 68 04 22 2b ab-ee a6 0a c3 98 80 04 bf   ...h."+.........
    03b0 - 99 8b 9b 67 6e d3 fc 25-ab 87 01 74 8c 29 c8 8b   ...gn..%...t.)..
    03c0 - 10 f0 b5 24 a9 71 e9 66-a4 65 cf a8 ee 2f ab 4c   ...$.q.f.e.../.L
    03d0 - 0a c0 08 87 1e 34 84 c1-a6 fe 7b 55 42 bb b2 0c   .....4....{UB...
    03e0 - 46 c4 1a 77 df cb 9c 8f-9f de 9d 57 8a 5c e1 12   F..w.......W.\..
    03f0 - 43 8e f3 fe 09 63 7f 47-c0 31 bc 51 f1 59 2e fb   C....c.G.1.Q.Y..
    0400 - 89 f7 16 99 20 eb 52 e3-5f 11 70 4a c4 9e 19 5d   .... .R._.pJ...]
    0410 - 29 11 23 f6 9b f9 d1 2f-6c f9 55 54 53 c5 65 6a   ).#..../l.UTS.ej
    0420 - c7 b0 26 cc 42 b6 8d c3-19 d8 f0 57 7d 55 59 65   ..&.B......W}UYe
    0430 - 6c 39 8c a0 69 51 d2 3d-d4 d4 71 c5 7f 6e eb f3   l9..iQ.=..q..n..
    0440 - 46 45 2a 73 a6 1c cb ec-47 35 13 05 81 53 02 6f   FE*s....G5...S.o
    0450 - f1 ae 8c 27 a2 b7 05 0d-e3 f9 20 46 1d 4a d6 ce   ...'...... F.J..
    0460 - b6 19 72 0f 3f 60 1e 65-57 5c 55 a3 b5 4d f1 05   ..r.?`.eW\U..M..
    0470 - 2b 41 a2 47 2e a9 63 42-be 37 e1 d2 28 92         +A.G..cB.7..(.

    Start Time: 1600656460
    Timeout   : 300 (sec)
    Verify return code: 18 (self signed certificate)
---
closed
		
			

工作正常

		
iMac:config neo$ curl -k -i https://config:s3cr3t@192.168.3.85:8888/netkiller-dev.json
HTTP/2 200 
set-cookie: JSESSIONID=75D0C2900D87C789DF596220FA77012D; Path=/; Secure; HttpOnly
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
cache-control: no-cache, no-store, max-age=0, must-revalidate
pragma: no-cache
expires: 0
strict-transport-security: max-age=31536000 ; includeSubDomains
x-frame-options: DENY
content-type: application/json
content-length: 100
date: Mon, 21 Sep 2020 02:51:11 GMT

{"sms":{"gateway":{"url":"https://sms.netkiller.cn/v1","username":"netkiller","password":"123456"}}}