Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ioc_sixiang_license
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zengtianlai3
ioc_sixiang_license
Commits
27ee94d5
Commit
27ee94d5
authored
Feb 01, 2023
by
AfirSraftGarrier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
回退一些
parent
ecbca27e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
12 deletions
+7
-12
TcpServer.java
license/src/main/java/iot/sixiang/license/net/TcpServer.java
+4
-10
LibHelper.java
...rc/main/java/iot/sixiang/license/third_lib/LibHelper.java
+2
-1
CommonUtil.java
...se/src/main/java/iot/sixiang/license/util/CommonUtil.java
+1
-1
No files found.
license/src/main/java/iot/sixiang/license/net/TcpServer.java
View file @
27ee94d5
...
...
@@ -12,10 +12,9 @@ import io.netty.channel.socket.nio.NioServerSocketChannel;
import
io.netty.handler.ssl.ClientAuth
;
import
io.netty.handler.ssl.SslContext
;
import
io.netty.handler.ssl.SslContextBuilder
;
import
iot.sixiang.license.util.CommonUtil
;
import
lombok.SneakyThrows
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.core.io.Resource
;
import
java.io.File
;
...
...
@@ -29,17 +28,12 @@ public class TcpServer {
this
.
channelInitializer
=
channelInitializer
;
}
@SneakyThrows
private
File
getSECFile
(
String
name
)
{
Resource
resource
=
new
ClassPathResource
(
"sec/"
+
name
);
return
resource
.
getFile
();
}
@SneakyThrows
public
void
start
()
{
String
topPath
=
CommonUtil
.
getServerParentDirectory
()
+
File
.
separator
+
"/sec/"
;
SslContext
sslContext
=
SslContextBuilder
.
forServer
(
getSECFile
(
"server.crt"
),
getSECFile
(
"server.pkcs8.key"
))
.
trustManager
(
getSECFile
(
"ca.crt"
))
.
forServer
(
new
File
(
topPath
+
"server.crt"
),
new
File
(
topPath
+
"server.pkcs8.key"
))
.
trustManager
(
new
File
(
topPath
+
"ca.crt"
))
.
clientAuth
(
ClientAuth
.
REQUIRE
)
.
build
();
...
...
license/src/main/java/iot/sixiang/license/third_lib/LibHelper.java
View file @
27ee94d5
...
...
@@ -6,6 +6,7 @@ import iot.sixiang.license.util.CommonUtil;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PostConstruct
;
import
java.io.File
;
/**
* Title: LibHelper
...
...
@@ -21,7 +22,7 @@ public class LibHelper {
@PostConstruct
public
void
init
()
{
LibPathUtil
.
libDir
=
CommonUtil
.
getServerParentDirectory
();
LibPathUtil
.
libDir
=
CommonUtil
.
getServerParentDirectory
()
+
File
.
separator
+
"/libs"
;
safety
=
new
Safety
();
}
...
...
license/src/main/java/iot/sixiang/license/util/CommonUtil.java
View file @
27ee94d5
...
...
@@ -264,7 +264,7 @@ public class CommonUtil {
}
public
static
String
getServerParentDirectory
()
{
return
new
File
(
new
ApplicationHome
(
Constant
.
class
).
getSource
().
getParentFile
().
getPath
())
.
getParent
()
+
File
.
separator
+
"lib
"
;
return
new
File
(
new
ApplicationHome
(
Constant
.
class
).
getSource
().
getParentFile
().
getPath
())
+
File
.
separator
+
"file
"
;
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment