小编nez*_*reh的帖子

Java:sun.security.provider.certpath.SunCertPathBuilderException:无法找到请求目标的有效证书路径

我有一个类将从https服务器下载文件.当我运行它时,它会返回很多错误.我的证书似乎有问题.是否可以忽略客户端 - 服务器身份验证?如果是这样,怎么样?

package com.da;

import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.CharBuffer;
import java.util.concurrent.Future;

import org.apache.http.HttpResponse;
import org.apache.http.client.utils.URIUtils;
import org.apache.http.impl.nio.client.DefaultHttpAsyncClient;
import org.apache.http.nio.IOControl;
import org.apache.http.nio.client.HttpAsyncClient;
import org.apache.http.nio.client.methods.AsyncCharConsumer;
import org.apache.http.nio.client.methods.HttpAsyncGet;
import org.apache.http.nio.client.methods.HttpAsyncPost;

public class RSDDownloadFile {
    static FileOutputStream fos;

    public void DownloadFile(String URI, String Request) throws Exception
    {
        java.net.URI uri = URIUtils.createURI("https", "176.66.3.69:6443", -1, "download.aspx",
                "Lang=EN&AuthToken=package", null);
        System.out.println("URI Query: " + uri.toString());

        HttpAsyncClient httpclient = new DefaultHttpAsyncClient();
        httpclient.start();
        try {
            Future<Boolean> future = httpclient.execute(
                    new HttpAsyncGet(uri),
                    new ResponseCallback(), null);

            Boolean result …
Run Code Online (Sandbox Code Playgroud)

java ssl https ssl-certificate

222
推荐指数
13
解决办法
56万
查看次数

Boost Asio tcp :: resolver:找不到服务

我正在尝试使用Boost Asio创建一个HTTP客户端.我从asio复制了同步客户端示例,编译然后运行.不幸的是,在我的日志中,它显示找不到服务.当我跟踪代码时,我发现它是从以下代码抛出的:

boost::asio::io_service io_service;
// Get a list of endpoints corresponding to the server name.
tcp::resolver resolver(io_service);
//->if i removed the http, it has no error
tcp::resolver::query query("host.com", "http");
//->This part throws the service not found
tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);
tcp::resolver::iterator end;
Run Code Online (Sandbox Code Playgroud)

任何人都可以解释为什么抛出未找到的服务或者如何解决这个问题?

c++ service boost boost-asio resolver

6
推荐指数
1
解决办法
4084
查看次数

CABasicAnimation旋转返回原始位置

我正在使用CABasicAnimation旋转CALayer并且工作正常.问题是,当我尝试旋转同一层时,它会在旋转之前返回到原始位置.我的预期输出是,对于下一轮,它应该从它结束的地方开始.这是我的代码:

CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
animation.fromValue         = 0;
animation.toValue           = [NSNumber numberWithFloat:3.0];
animation.duration          = 3.0;
animation.timingFunction    = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
animation.removedOnCompletion = NO;
animation.fillMode          = kCAFillModeForwards;
animation.autoreverses      = NO;
[calayer addAnimation:animation forKey:@"rotate"];
Run Code Online (Sandbox Code Playgroud)

我的代码上有什么遗漏?谢谢

rotation calayer cabasicanimation ios

3
推荐指数
1
解决办法
7573
查看次数

Magick ++链接错误

我这里有一个使用Magick ++(ImageMagick接口)库的简单图像转换器代码.(Eclipse IDE)

#include <Magick++.h>
#include <string>
#include <iostream>

using namespace std;

using namespace Magick;

int main(int argc,char **argv) 
{ 
    Image image; 
    image.read("/home/usr1/test.tiff");
    image.write( "/home/usr1/test.bmp" ); 
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

我正在使用arm-linux目标进行交叉编译.代码编译成功,但在链接部分,我得到了未定义的引用错误.

/usr/local/lib/libMagick++/libMagickCore.a(dlopen.o)(.text+0x144): In function `vm_open':
ltdl/loaders/dlopen.c:194: undefined reference to `dlopen'
/usr/local/lib/libMagick++/libMagickCore.a(dlopen.o)(.text+0x158):ltdl/loaders/dlopen.c:198: undefined reference to `dlerror'
/usr/local/lib/libMagick++/libMagickCore.a(dlopen.o)(.text+0x16c): In function `vm_close':
ltdl/loaders/dlopen.c:212: undefined reference to `dlclose'
/usr/local/lib/libMagick++/libMagickCore.a(dlopen.o)(.text+0x17c):ltdl/loaders/dlopen.c:214: undefined reference to `dlerror'
/usr/local/lib/libMagick++/libMagickCore.a(dlopen.o)(.text+0x198): In function `vm_sym':
ltdl/loaders/dlopen.c:227: undefined reference to `dlsym'
/usr/local/lib/libMagick++/libMagickCore.a(dlopen.o)(.text+0x1ac):ltdl/loaders/dlopen.c:231: undefined reference to `dlerror'
Run Code Online (Sandbox Code Playgroud)

我使用以下命令编译代码:

/opt/Mx800SDK/vfitc/cross/bin/arm-linux-g++ -DMx870 -I/opt/Mx800SDK/vfitc/cross/arm-linux/include -I/usr/local/include/ImageMagick -I/opt/Mx800SDK/include -O2 -Wall …
Run Code Online (Sandbox Code Playgroud)

c++ linux imagemagick cross-compiling magick++

2
推荐指数
1
解决办法
3434
查看次数

如何在Lion中安装XCode 3.2.6(10.7.3)

在我的机器Lion 10.7.3上安装XCode 3.2.6时,我已经把头发拉了两天,但到目前为止我没有运气.我在这里按照安装说明:安装的Xcode 3.2.6在狮子终极版 ,在这里在Mac OS X狮子(10.7)安装的Xcode 3.2.6但两者都没有工作.我总是得到一个安装未知的错误,请参阅附图.请帮忙..非常感谢.在此输入图像描述

机器:Macbook操作系统:Mac OS X Lion 10.7.3安装了XCode 4.3

Apr  8 17:14:27 mo-macbook Installer[326]: Set authorization level to root for session
Apr  8 17:14:28 mo-macbook Installer[326]: Will use PK session
Apr  8 17:14:28 mo-macbook Installer[326]: Starting installation:
Apr  8 17:14:28 mo-macbook Installer[326]: Configuring volume "Mac OS X"
Apr  8 17:14:28 mo-macbook Installer[326]: Preparing disk for local booted install.
Apr  8 17:14:28 mo-macbook Installer[326]: Free space on "Mac OS X": 108.39 GB (108385030144 …
Run Code Online (Sandbox Code Playgroud)

macos xcode osx-lion

2
推荐指数
1
解决办法
6708
查看次数