Skip to content

Commit 15f2826

Browse files
committed
release v1.0.0
1 parent 82c35ae commit 15f2826

File tree

3 files changed

+41
-43
lines changed

3 files changed

+41
-43
lines changed

LICENSE

Lines changed: 17 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,21 @@
1-
Copyright (c) <2021> <https://javaherobrine.github.io>
1+
MIT License
22

3-
"Anti 996" License Version 1.0 (Draft)
3+
Copyright (c) [2025] [Java_Herobrine]
44

5-
Permission is hereby granted to any individual or legal entity
6-
obtaining a copy of this licensed work (including the source code,
7-
documentation and/or related items, hereinafter collectively referred
8-
to as the "licensed work"), free of charge, to deal with the licensed
9-
work for any purpose, including without limitation, the rights to use,
10-
reproduce, modify, prepare derivative works of, distribute, publish
11-
and sublicense the licensed work, subject to the following conditions:
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
1211

13-
1. The individual or the legal entity must conspicuously display,
14-
without modification, this License and the notice on each redistributed
15-
or derivative copy of the Licensed Work.
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
1614

17-
2. The individual or the legal entity must strictly comply with all
18-
applicable laws, regulations, rules and standards of the jurisdiction
19-
relating to labor and employment where the individual is physically
20-
located or where the individual was born or naturalized; or where the
21-
legal entity is registered or is operating (whichever is stricter). In
22-
case that the jurisdiction has no such laws, regulations, rules and
23-
standards or its laws, regulations, rules and standards are
24-
unenforceable, the individual or the legal entity are required to
25-
comply with Core International Labor Standards.
26-
27-
3. The individual or the legal entity shall not induce, suggest or force
28-
its employee(s), whether full-time or part-time, or its independent
29-
contractor(s), in any methods, to agree in oral or written form, to
30-
directly or indirectly restrict, weaken or relinquish his or her
31-
rights or remedies under such laws, regulations, rules and standards
32-
relating to labor and employment as mentioned above, no matter whether
33-
such written or oral agreements are enforceable under the laws of the
34-
said jurisdiction, nor shall such individual or the legal entity
35-
limit, in any methods, the rights of its employee(s) or independent
36-
contractor(s) from reporting or complaining to the copyright holder or
37-
relevant authorities monitoring the compliance of the license about
38-
its violation(s) of the said license.
39-
40-
THE LICENSED WORK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
41-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
42-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
43-
IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM,
44-
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
45-
OTHERWISE, ARISING FROM, OUT OF OR IN ANY WAY CONNECTION WITH THE
46-
LICENSED WORK OR THE USE OR OTHER DEALINGS IN THE LICENSED WORK.
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

io/github/javaherobrine/net/ServerSideClient.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ public class ServerSideClient extends Client {
66
private EventHandler handle;
77
protected ServerSideClient(Socket ac,Server serv,EventHandler handler) throws IOException {
88
super(ac);
9-
// TODO Auto-generated constructor stub
109
handle=handler;
1110
server=serv;
1211
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package io.github.javaherobrine.net;
2+
import javax.net.ssl.*;
3+
import java.io.*;
4+
import java.net.*;
5+
import java.security.*;
6+
import java.security.cert.*;
7+
public class TLSUtils {
8+
public static Socket defaultSSLSocket(String host,int port) throws IOException {
9+
return SSLSocketFactory.getDefault().createSocket(host,port);
10+
}
11+
public static SSLContext getFromKSFile(String file,String version,String encrypt,char[] pwd) throws IOException, NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException, CertificateException{
12+
SSLContext context = SSLContext.getInstance(version);
13+
KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());
14+
InputStream in=new FileInputStream(file);
15+
keystore.load(in,pwd);
16+
in.close();
17+
KeyManagerFactory km=KeyManagerFactory.getInstance(encrypt);
18+
km.init(keystore,pwd);
19+
TrustManagerFactory tmf=TrustManagerFactory.getInstance(encrypt);
20+
tmf.init((KeyStore)null);
21+
context.init(km.getKeyManagers(),tmf.getTrustManagers(),null);
22+
return context;
23+
}
24+
}

0 commit comments

Comments
 (0)