我遇到ssl配置问题,我的配置如下:
server.port=8449
# self signed cert with CN=localhost used for https method tests
server.ssl.key-store=keystore.p12
server.ssl.key-password=password
server.ssl.key-alias=some-alias
server.ssl.key-store-type=PKCS12
Run Code Online (Sandbox Code Playgroud)
如果与1.3.7版本的弹簧启动一起使用,一切正常.如果在客户端升级到1.4.0,我会得到:
javax.ws.rs.ProcessingException: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:287)
at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:255)
at org.glassfish.jersey.client.JerseyInvocation$2.call(JerseyInvocation.java:700)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444)
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:696)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:448)
Run Code Online (Sandbox Code Playgroud)
并从chrome结果调用ssl端口:
客户端和服务器不支持通用SSL协议版本或密码套件.当服务器需要不再被认为是安全的RC4时,可能会导致这种情况.
来自Firefox的类似错误.
正如我所说,只有配置不同的东西是spring boot版本.我在配置中遗漏了什么,所以它可以用于较新版本的弹簧靴?
在此先感谢干杯!
PS我对ssl相关主题知之甚少,所以请尝试解释它有点简单.
我试图实现strcmp:
int strCmp(char string1[], char string2[] )
{
int i=0,flag=0;
while(flag==0)
{
if (string1[i]>string2[i])
{
flag=1;
}
else if (string1[i]<string2[i])
{
flag=-1;
}
else
{
i++;
}
}
return flag;
}
Run Code Online (Sandbox Code Playgroud)
但我坚持用户将输入相同字符串的情况,因为该函数使用1和-1,但它不返回0.任何人都可以帮忙吗?请不要指点!
我试图用Salt-Api,所以我创建了一个salt-api.conf在/etc/salt/master.d/如下:
external_auth:
pam:
saltuser:
- .*
- '@wheel' # to allow access to all wheel modules
- '@runner' # to allow access to all runner modules
- '@jobs' # to allow access to the jobs runner and/or wheel module
rest_cherrypy:
port: 8000
ssl_crt: /etc/pki/tls/certs/localhost.crt
ssl_key: /etc/pki/tls/certs/localhost.key
disable_ssl: True
webhook_disable_auth: True
webhook_url: /hook
Run Code Online (Sandbox Code Playgroud)
用户输入/etc/salt/master设置为user: root.因此,当我尝试使用pam本地身份验证时,它可以工作:
sudo salt -a pam '*' test.ping
username: saltuser
password: saltuser
minion:
True
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试使用curl时,它会失败:
curl …Run Code Online (Sandbox Code Playgroud) 我得到了动态变量名称
varname = "data" + newid + "['" + name + "']";
Run Code Online (Sandbox Code Playgroud)
我想为动态变量赋值.我试过这个
eval(varname) = value;
Run Code Online (Sandbox Code Playgroud)
但它不起作用.为了为动态变量赋值,我需要做什么?
我真的很喜欢你可以将同一本食谱的多个版本上传到Chef服务器的方式.您还可以在元数据文件中指定cookbook版本.例如
depends 'base-config', '= 1.2.1'
Run Code Online (Sandbox Code Playgroud)
我喜欢Salt.但是,我找不到任何版本管理和盐状态/公式的必备条件.我真的很惊讶,因为我认为这是配置管理的基本要求.我错过了什么吗?salt如何处理状态/公式文件版本?
考虑这个测试类,使用JUnit 4和JUnitParams:
import static junitparams.JUnitParamsRunner.$;
import junitparams.JUnitParamsRunner;
import junitparams.Parameters;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(JUnitParamsRunner.class)
public class JUnitParamsExample {
private int[] getIntArray() {
int array[] = new int[2];
array[0] = 1;
array[1] = 2;
return array;
}
public Object getInts() {
return $($(getIntArray()));
}
@Parameters(method = "getInts")
@Test
public void testIntArray(int... values) {
//
}
private String[] getStringArray() {
String array[] = new String[2];
array[0] = "a";
array[1] = "b";
return array;
}
public Object getStrings() {
return $($(getStringArray()));
}
@Parameters(method …Run Code Online (Sandbox Code Playgroud) 我正在使用Spring Integration(4.2.2)和Spring Integration Java DSL(1.1.0).我有两种情况需要与HTTP集成其他服务.我不确定是使用出站通道适配器还是出站网关.我想两者都会在技术上有效,但什么是"最佳实践"?
我不是在等待回复中的任何数据,但我会等待响应代码 - 2xx或错误(4xx/5xx).调用者应该阻止调用,如果是HTTP错误响应代码,调用者应该收到异常.当我使用出站通道适配器时,这工作正常,但我想知道使用出站网关是否更可取?
我已经阅读了有关出站通道适配器和出站网关之间区别的一般问题,但我不确定它是如何适用于我的情况的.
我的代码:
@Component
public class Notifier { // this is the client
@Autowired
public MessageChannel notificationChannel;
public void notifySuccess(String applicationNumber) {
// this should block until a HTTP response is received an should throw an exception if HTTP error code was returned
notificationChannel.send(new GenericMessage<>(new SuccessMessage()));
}
}
@Configuration
public class NotificationConfig {
@Bean
public MessageChannel notificationChannel() {
return MessageChannels.direct().get();
}
@Bean
public IntegrationFlow notificationFlow(@Value("${url.notification}") URI notificationUrl) {
return …Run Code Online (Sandbox Code Playgroud) private InputStream input;
private InputStreamReader inputReader;
private BufferedReader reader;
try {
input = new InputStream();
inputStreamReader = new InputStreamReader(inputStream);
reader = new BufferedReader(inputStreamReader);
// do I/O operations
} catch (IOException e) {
Log.d("IOException", "The Data Could Not Be Read =/");
} finally {
try {
reader.close(); // now will this, by default, close all other streams? OR
/*
* input.close(); inputStream.close(); //is this necessary, along with
* reader.close();
*/
} catch (IOException ex) {
ex.printStackTrace();
}
}
Run Code Online (Sandbox Code Playgroud)
我今天遇到了这个问题,并且不确定它们是否会被关闭,因为它已被包裹,或者是否仍需要独立关闭所有流.
java ×5
salt-stack ×2
spring ×2
c ×1
c# ×1
integration ×1
javascript ×1
junit ×1
junitparams ×1
messaging ×1
networking ×1
python ×1
spring-boot ×1
ssl ×1
strcmp ×1