我使用SSL连接将Web客户端连接到服务器.它长时间没有任何问题.但从昨天起,它给出了以下错误,任何人都可以告诉我原因.
javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkEOF(SSLSocketImpl.java:1172)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:65)
at net.schubart.fixme.internal.MessageInput.readExactly(MessageInput.java:166)
at net.schubart.fixme.internal.MessageInput.readMessage(MessageInput.java:78)
at cc.aot.itsWeb.ClientWriterThread.run(ClientWriterThread.java:241)
at java.lang.Thread.run(Thread.java:619)
clientWriter.ready
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:136)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1586)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:865)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1029)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:621)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:59)
at java.io.OutputStream.write(OutputStream.java:58)
at net.schubart.fixme.internal.Message.write(Message.java:267)
at net.schubart.fixme.internal.MessageOutput.writeMessage(MessageOutput.java:53)
Run Code Online (Sandbox Code Playgroud) 我尝试了解它们两个但我没有发现任何差异,除了strcoll() 这个参考说它
根据LC_COLLATE类别定义的当前语言环境比较两个空终止字符串.
在第二个想法,我知道我正在问另一个问题的详细答案,这个区域设置究竟是什么,对于C和C++?
为此道歉,我是一名学生正在努力学习C++,我只是觉得如果我问这个问题并且对此有很多正确的看法会更好,所以我很抱歉提出愚蠢的问题.我只是觉得问题比不知道更好.
我分别理解地址运算符&和const关键字的含义.但是,当我在阅读某个地方的示例代码时,我看到const&使用了,只是想要暗示的是什么?
它用于代替函数原型中的参数,例如:
void function (type_Name const&);
Run Code Online (Sandbox Code Playgroud)
如果只使用其中一个我会理解,但我在这里有点困惑所以一些专业的见解会很棒.
我在网上发现了这个脚本并尝试使用它:
#!/bin/sh
# Target directory
TARGET=$3
echo "Copying to $TARGET"
for i in $(git diff --name-only $1 $2)
do
# First create the target directory, if it doesn't exist.
mkdir -p "$TARGET/$(dirname $i)"
# Then copy over the file.
cp "$i" "$TARGET/$i"
done
echo "Done";
Run Code Online (Sandbox Code Playgroud)
我已经在线验证了脚本,脚本没问题.我也试图以各种方式改变它,但它对我不起作用.
我也尝试过运行类似的东西:
#!/bin/sh
# Target directory
TARGET=$3
echo "Copying to $TARGET"
for i in $(ls)
do
echo "text"
done
Run Code Online (Sandbox Code Playgroud)
我仍然得到同样的错误:
./git-copy.sh: line 6: syntax error near unexpected token `$'do\r''
'/git-copy.sh: line 6: `do
Run Code Online (Sandbox Code Playgroud)
这是为什么?
这是我的代码:
#include <iostream>
int main(int argc, char const *argv[])
{
std::string s = "hello";
std::cout << s.size() << std::endl;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
令我惊讶的是,我可以编译并运行它clang++,虽然我甚至不添加#include <string>.
那么,是否有必要添加#include <string>才能使用std::string?
以下代码为两者打印出相同的地址a并b使用GCC(未与其他编译器一起测试):
#include <stdio.h>
void show() {
{
static char a[0];
printf("%p\n", a);
}
{
static char b[0];
printf("%p\n", b);
}
}
int main() {
show();
}
Run Code Online (Sandbox Code Playgroud)
我的问题是C标准是否允许多个变量具有相同的地址,或者这只是GCC的扩展?
在使用和性能方面使用List<Map<String, String>>vs有什么区别List<Object>.假设我必须创建一个只有3种键值对的映射列表,我可以创建一个只有3个属性的对象并创建一个对象列表.
这里的问题是在哪种场景中应该使用哪两种方法?
我正在尝试正确实现“四连环”游戏AI,但仍无法利用我愚蠢的AI行为:
我的项目包含以下两个GitHub存储库:
其中GameAI包含:
package net.coderodde.zerosum.ai.impl;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.coderodde.zerosum.ai.EvaluatorFunction;
import net.coderodde.zerosum.ai.GameEngine;
import net.coderodde.zerosum.ai.State;
/**
* This class implements the
* <a href="https://en.wikipedia.org/wiki/Minimax">Minimax</a> algorithm for
* zero-sum two-player games.
*
* @param <S> the game state type.
* @param <P> the player color type.
* @author Rodion "rodde" Efremov
* @version 1.6 (May 26, 2019)
*/
public final class SortingAlphaBetaPruningGameEngine
<S extends State<S>, P …Run Code Online (Sandbox Code Playgroud) 给定两个任意大小的类型T和U,其中U: From<T>,标准库是否有理由不提供From<Option<T>> for Option<U>a where U: From<T>?我尝试这样做,但遇到了冲突的实现错误,所以显然存在限制,只是不确定在哪里。是的,我知道我可以用 a 来做到这一点Option::map(),但似乎 std 应该开箱即用。
enum Opt<T> {
Some(T),
None,
}
impl<T: From<U>, U> From<Opt<T>> for Opt<U> {
fn from(opt: Opt<T>) -> Self {
match opt {
Opt::Some(t) => Opt::Some(t.into()),
Opt::None => Opt::None,
}
}
}
struct A;
struct B;
impl From<A> for B {
fn from(_: A) -> Self {
B
}
}
fn main() {
let a = Opt::Some(A);
let _b: …Run Code Online (Sandbox Code Playgroud)