Need with https url
Dear All,
import Base64Encoder.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.net.*;
import java.security.*;
import com.sun.net.ssl.*;
import com.sun.net.ssl.HttpsURLConnection;
try {
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
URL url = new URL("https://abc/xyz");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
I have added th jnet,jcert and jsse in wlserver6.1\lib directory
But it not working in weblogic6.1 sp2 what else do i need to get it working .
The same code works fine in my IDE.
Any help is highly appreciated.
Thanks,
ag
Try it like
URL url = new URL(null, "https://abc/xyz",
new com.sun.net.ssl.internal.www.protocol.https.Handler());
...url.openConnection();
ag <[email protected]> wrote:
> Dear All,
> import Base64Encoder.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
> import java.io.*;
> import java.net.*;
> import java.security.*;
> import com.sun.net.ssl.*;
> import com.sun.net.ssl.HttpsURLConnection;
> ...
> .
> try {
> Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
> System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
> .
> .
> URL url = new URL("https://abc/xyz");
> HttpURLConnection connection = (HttpURLConnection) url.openConnection();
> .
> I have added th jnet,jcert and jsse in wlserver6.1\lib directory
> But it not working in weblogic6.1 sp2 what else do i need to get it working .
> The same code works fine in my IDE.
> Any help is highly appreciated.
> Thanks,
> ag
Dimitri
Similar Messages
-
SOAP receiver channel with https url
Hi All,
We are working on SAP PO 7.4. We have RFC to SOAP scenario. To connect with external target system we are using https url.
We don't have any sign, encrypt requirement, do we still need to maintain certificates in Key Store as we are using https?
Thanks
ShiviNo.you don't have to select that option.
But you have to install the certificates.
Below one can help you.
How to Enable SSL certificate at the receiver SOAP Adapter -
Catalog Manager not working with https url
Hi,
On the BI server, we had to implement SSL and now I do not seem to be able to connect to the catalogue manager.
The connection to the BI User interface works fine with https, it is only the catalogue manager that shows this error:
Unknown connection error: sun.security.validar.Validator.Exception:PKIX path build failed:
sun.security.provider.certpah.SunCertPathBuilderException: unable to find
valid certification path to requested target
Thanks and Regards
G.Hi,
Try to connect the catalogue manager by using below kind of URL.
e.x:
http://IP:9704/analytics/saw.dll
Thanks
Deva -
WSRP Provider reg not working with https url
Our portal is configured with https, listening to a virtual host (https://portalpilot:4443)
In order to consume WSRP / JSR168 java portlets we
- created a new OC4J container (wsrp_dev)
- installed the portlet-container ( $MIDTIERHOME/j2ee/wsrp_dev/ java -jar wsrp-install.jar)
- started the container & deployed the samples
all OK
but when trying to register the (tested & OK ) url https://portalpilot:4443/portalapp?WSDL
in the Provider Registration we got an error (error in provider url)
changing the url to the non-ssl host (http://gogol:7777) was the (pseudo) solution.
is this behavior by design? we would like to use SSL throughoutOOS,
Did the info in the release notes solve your problem?
It seems to me that the release notes address a similar but different issue. You want to run under https. The release notes are instructing you to change all references to https to http in the WSDL file. I don't see how this would fix the problem of trying to register a WSRP provider with a WSDL URL that uses https.
The reason I ask is because I am encountering the same problem.
Thanks.
Message was edited by:
user571987 -
Download URLs doesn't work with https url's?
I've setup a simple workflow to pull manuals from a local library. The script looks like this:
Get Current Webpage from Safari
Get Link URLs from Webpages (Only return URLs in the same domain as the starting page unchecked)
Filter URLs Entire URL ends with .pdf
(stepping through it the correct files appear here)
Download URLs
In my practice run, with only 2 pdfs, nothing gets downloaded. I then go to a regular non https website and use the same workflow to download images, exchanging .pdf for .jpg in the filter.
Is it https that is preventing the download?I think I can confirm that *Download URLs* will not work with https: links. The same library had some files linked with http: and the workflow had no problem with those.
-
Difficulty with HTTPS URL monitoring using GRMG Lite
Hello,
I am getting error when i use GRMG lite scenario which is HTTPS URL. The error that i get is 'Reason for HTTP POST failure:No error message returned' when i start my scenario, and scenario failed. Could you please help me?
Thanks a lot
VenkyHello Venky
I have the same problem
Could you solve this in the meantime?
Thank you
Theo -
Search is showing no results with HTTPS URL
Hi All,
A power user wanted to have https entry in one of the content sources and asked us to remove the http entry for the web application. After that I have performed the incremental search.
However, the search on the https on the web site started showing NO results. We have configure search settings on the site as follows:
After that search is able to search but it search for other content sources. In the search service application we have several web applications and we want to scope to that specific web application and users should perform search only in that web application
scope. How could I scope search to a specific web application?
Our document library search is also retuning with no results.
Any suggestion to resolve the issue will be greatly appreciated.
Thanks in advance.
SandyHi Sandy,
I think you have to edit the publick urls, and switch the default zone and intranet zone URLs, set the https as default zone public URL, then start a full crawl in a proper time if it impacts the user on production server, you may also test in a test
environment firstly.
Also there is aother article which should help.
http://ragavj.blogspot.in/2014/09/layouts15osssearchresultsaspx-not.html
https://support.microsoft.com/en-us/kb/2000365?wa=wsignin1.0
Thanks
Daniel Yang
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected] -
Help Needed With Simple URL Encoding
I am making a simple webserver. I have seen that the spaces are converted to %20 as the url is encoded. But what I would like to do is to also allow the hosting of files that contain %20 in their names i.e. I would like to differentiate between two cases when the user entered a space and it is converted into %20 and when the user explicity wrote %20 in the url. I tried to do it via the URLDecoder class but it converts %20 into a space in both cases. Any help will be greatly appreciated.
omariqbalnaru wrote:
. I would like to differentiate between two cases when the user entered a space and it is converted into %20 and when the user explicity wrote %20 in the url.You cannot. There is no difference at your end between those two cases. -
Socket communication with HTTP server : how to send a form variable ?
Hi everyone,
I'm trying to program a Socket application that calls a CGI programmed in ASP and sends a variable with some content via the POST HTTP method.
My problem is that I'm unable to retrieve my variable content in the CGI. I don't know what I'm doing wrong when sending my variable. Here are the main steps of my application
[Client side]
- Create an URL
- Open a connection
- Send header info with variable name and content via POST method
- Read server response
[Server side]
- Request the variable
- Store its content in a file
Here's the code of my class :
import java.net.*;
import java.io.*;
public class SocketTest{
public static void main(String args[]){
//create the URL
URL url = null;
String strURL = "http://192.168.1.11/htmleditor/cgi.asp";
try{
url = new URL(strURL);
catch(MalformedURLException exc){
System.out.println("Invalid URL : " + strURL);
//create a socket
Socket socket = null;
try{
int port = url.getPort();
if (port < 0){
port = 80;
socket = new Socket(url.getHost(), port);
catch(Exception exc){
exc.printStackTrace();
OutputStream out = null;
InputStream in = null;
try{
//configure request
String data = "htm_content=toto";
String request = "POST "+ url + " HTTP/1.0\r\n" +
"Accept: */*\r\n" +
"Content-length: " + String.valueOf(data.length()) + "\r\n" +
"Host: JAVA_HOST\r\n" +
"User-Agent: Generic\r\n\r\n" +
"htm_content=toto";
//send request
out = socket.getOutputStream();
out.write(request.getBytes());
out.flush();
//read server response
in = socket.getInputStream();
int bufferSize = 1024;
byte responseBytes[] = new byte[bufferSize];
while ((bufferSize = in.read(responseBytes)) > 0){
System.out.print(new String(responseBytes, 0,bufferSize));
catch(IOException exc){
System.out.println(exc);
//Close streams and sockets
try{
in.close();
catch(IOException exc){
exc.printStackTrace();
try{
out.close();
catch(IOException exc){
exc.printStackTrace();
try{
socket.close();
catch(IOException exc){
exc.printStackTrace();
}Here's the code of my ASP CGI page (called cgi.asp) :
//CGI.ASP - Begin
<%
Option Explicit
Dim objFso, objFile, strHtmContent, strFileName
On Error Resume Next
Set objFso = Nothing
Set objFile = Nothing
Set objFso = Server.CreateObject("Scripting.FileSystemObject")
strFileName = Server.MapPath("htm_content.htm")
Set objFile = objFso.CreateTextFile(strFileName, True)
strHtmContent = Request("htm_content")
If len(strHtmContent) > 0 Then
objFile.Write strHTMContent
Else
objFile.Write "NO CONTENT RECEIVED"
End If
%>
<html>
<head>
<script language="javascript">
function closeAll()
window.close();
return 0;
</script>
<body onLoad="javascript:closeAll();">
</body>
</html>
//CGI.ASP - ENDWhen I execute my SocketTest app I get this output:
F:\JavaDev\htmleditor\docs>java SocketTest
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Fri, 12 Jul 2002 15:31:56 GMT
Connection: Keep-Alive
Content-Length: 192
Content-Type: text/html
Set-Cookie: ASPSESSIONIDQQGGGKMU=MMPPMLEDGDEMCCJDBGOKMNDC; path=/
Cache-control: private
<html>
<head>
<script language="javascript">
function fermerTout()
window.close();
return 0;
</script>
<body onLoad="javascript:fermerTout();">
</body>
</html>
The file "htm_content.htm" is created but it has this content :
NO CONTENT RECEIVED
This means the server was unable to retrieve the content of the variable called "htm_content"
REM : the variable is called like this 'cause I intend to use it to send HTML content
Any idea of what I'm doing wrong ?
Thanxs in advance for any help,
Diego TERCEROFor the POST request you'll only need (with HTTP 1.0)
String request = "POST "+ url + " HTTP/1.0\n" +
"Content-type: application/x-www-form-urlencoded\n" +
"Content-Length: " + String.valueOf(data.length()) + "\n" +
"\n" +
data;
Note the Content-type header.
Fred (Donne les duke�) -
Https URL entry in AAM SharePoint
Hi, I need to publish one SharePoint site over Internet with https URL.
Currently I am using default URL to access internally, so I am creating new URL for Internet under Internet Zone in AAM with "https://desiredURL" .
So my question is can I entry https URL in AAM in Central Admin?
Or else there are other options to publish https URL for SharePoint site.
guide me.You need to extend your web application and enable SSL for the extended web site. After these changes, update the changes in AAM. Refer to the following post for more information
https://nhutcmos.wordpress.com/2013/07/26/configure-ssl-certificate-for-sharepoint-external-https-access/
https://store.bamboosolutions.com/kb/article.aspx?id=12666
Cheers, -
Http webrequest with https uri is not working in windows phone 8.1
I am building a Windows Phone application in which the uat environment was working fine with http url,
But the production url is https, then the applictaion is not able to get the response from http web request method. Please help me on the same.
Cynthia MareiaAny errors returned in response?
http://developer.nokia.com/community/wiki/Using_Crypto%2B%2B_library_with_Windows_Phone_8 -
We are using a https URL in URL iview and it is causing the issue. The issue is it is going out of the portal, thought it is opened in the same window.
The portal URL is not more seen and is overwritten by the URL iview URL, and also the portal top menu is not seen.
But the same thing is working fine with http URLs.I think the issue is with https.
Can somebody please help me?
ThanksHi,
did you have a look at the html-coding of the pages you are trying to call via URL-iView? Is there maybe something like 'target=top' or 'target=parent'? I think this might be a reason for the error you are describing
Kind regards
karin -
Biztalk want to connect to PI by HTTP adapter. Biztalk needs PI -HTTP URL. The idoc is ORDERS05. How HTTP URL can be generated and how it can be checked that URL is OK.
http://<XISERVERHOSTNAME>:<80XX>/sap/xi/adapter_plain?namespace=<SenderNameSpace>&interface=<SenderInterfaceName>&service=<SenderBusinessSystem>&party=&agency=&scheme=&QOS=BE&sap-user=<USERNAME>&sap-password=<PASSWORD>&sap-client=<CLIENTNUMBER>&sap-language=EN
Check your XI Server ABAP HTTP port using SMICM tcode.
Edited by: Praveen Gujjeti on Mar 18, 2009 9:30 PM -
Flash player not playing https urls (Videos)
We want to use flash player on web which we actually did it, but the problem is that it is not able to play the videos with https urls. It is doing good with http urls but not with https. Can you please guide me to make it work.
Thanks in advance,
Raju.Kindly check it. This is rtmp (FMS) connection or process download connection.
Script
Ex:
nc.connection(null) - then this is run in http url (video/vid1.flv enough)
nc.connection("rtmp://sample/") - then this is not run in http url. -
Need help with contacting HTTPS URL
Hi,
I am new bie to Java Security. I do not know where to start off with. Here is the requirement.
I need to contact an HTTPS URL and this URL gives me output which is encypted data.
I have to save this ecnrypted data into a file and I have the KEY to decrypt the data.
I have tried several ways (all listed below) to get it working. But I am not successful. I get
"javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found"
Can you guys give me some insight on how to proceed?
Thanks
Mathew
import java.util.*;
import java.text.*;
import java.net.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.security.Permission;
import javax.net.ssl.HttpsURLConnection;
import java.security.*;
import java.security.cert.*;
import javax.net.ssl.*;
import java.io.*;
public class temp
protected BufferedReader messageResponseReader;
private static final String CERTIFICATE_TYPE = "SunX509";
private static final String KEYSTORE_TYPE = "JKS";
private static final String SSL_PROTOCOL = "TLS";
private static final String CERTIFICATE_FACTORY_TYPE = "X.509";
public static void main(String args[])
try
try{
temp tmp = new temp();
String url = "https://test.mysite.com/one/perform.jsp?mode=get&check=true";
tmp.sendRequest(url);
}catch(Exception e)
e.printStackTrace();
catch(Exception e){
e.printStackTrace();
public String sendRequest(String urlString) throws Exception
StringBuffer response = null;
BufferedReader messageReader = null;
try
String username = "user";
String password = "pwd";
String encoding = new sun.misc.BASE64Encoder().encode("username:password".getBytes());
//java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
//System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
// Needed for validation of the server certificate
//System.setProperty("javax.net.ssl.trustStore","C:\\cert\\key.txt");
// Needed for providing a clint certificate for client authentication
//System.setProperty("javax.net.ssl.keyStore","C:\\cert\\key.txt");
//System.setProperty("javax.net.ssl.keyStorePassword","te5t1ng");
//System.setProperty("ssl.SocketFactory.provider", "com.sun.net.ssl.internal.ssl.Provider");
KeyStore ks;
ks = KeyStore.getInstance("JKS");
CertificateFactory cf = CertificateFactory.getInstance(CERTIFICATE_FACTORY_TYPE);
TrustManagerFactory tmf = TrustManagerFactory.getInstance(CERTIFICATE_TYPE);
KeyManagerFactory kmf = KeyManagerFactory.getInstance(CERTIFICATE_TYPE);
FileInputStream fis = new FileInputStream("C:\\cert\\key.txt");
BufferedInputStream bis = new BufferedInputStream(fis);
Collection c = cf.generateCertificates(fis);
Iterator i = c.iterator();
while (i.hasNext()) {
java.security.cert.Certificate cert = (java.security.cert.Certificate)i.next();
System.out.println(cert);
ks.load(null, null);
X509Certificate the_cert = (X509Certificate)cf.generateCertificate(bis);
ks.setCertificateEntry("server_cert",the_cert);
tmf.init(ks);
ks = KeyStore.getInstance(KEYSTORE_TYPE);
ks.load(null, null);
the_cert = (X509Certificate)cf.generateCertificate(new FileInputStream("key.txt"));
ks.setCertificateEntry("client_cert",the_cert);
kmf.init(ks, null);
SSLContext ctx = SSLContext.getInstance(SSL_PROTOCOL);
KeyManager[] km = kmf.getKeyManagers();
TrustManager[] tm = tmf.getTrustManagers();
ctx.init (km, tm, null);
HttpsURLConnection.setDefaultSSLSocketFactory(ctx.getSocketFactory());
urlString = urlString.replaceAll(" ","%20");
URL url = new URL(urlString);
//HttpsURLConnection urlCon = (HttpsURLConnection)url.openConnection();
HttpURLConnection urlCon = (HttpURLConnection)url.openConnection();
//com.sun.net.ssl.HttpsURLConnection urlCon = (com.sun.net.ssl.HttpsURLConnection)urlCon;
/*urlCon.setRequestProperty("Host", url.getHost());*/
urlCon.setDoOutput(true);
urlCon.setDoInput(true);
urlCon.setRequestMethod("POST");
urlCon.setUseCaches (false);
urlCon.setAllowUserInteraction(true);
urlCon.setInstanceFollowRedirects(true);
urlCon.setRequestProperty ("Authorization", "Basic " + encoding);
//Permission permision = urlCon.getPermission();
//System.out.println("permission name:"+permision.getName());
urlCon.connect();
//messageReader = new BufferedReader(new InputStreamReader(urlCon.getInputStream()));
//response = new StringBuffer();
//String line;
//while((line = messageReader.readLine()) != null){
// response.append(line);
// response.append("\n");
catch (Exception e) {
e.printStackTrace();
throw e;
return "testing";sorry for the junk data.. Need to post it again
Maybe you are looking for
-
Each time i open up the computer there is a warning signt that says - there is no desk - put in desk
Presario CQ57 Notebook PC QH992EA#UUW Every time I open up my computer there is a warning sign comming up that says - There is no desk in this unit. Put in a desk in this unit \Device\Harddisk1\DR1 Please help me !
-
Problem in playing back mp3 which was recorded as wav file
Hi all, I have recorded sound using my program. It uses classes like AudioSystem. And it's able to record and play also. but in my site I have an mp3 player. So i thought of converting the recorded wav file into mp3. For this i used LAME utility in L
-
How much "power" will my VGA out give me?
I was just wondering, how much power the graphics card is on my iBook G3. I have used the TV out through the headphone jack, and it works ok, but very low quality. I see there is a mini-VGA out. For $20 - I can get an adapter that turns that port int
-
A teacher at my school received an iPad at a training. She entered a passcode and then forgot it. The computer that the iPad was synced with is unavailable to use it to return it to the restore mode. How can this be unlocked so it can be used? Than
-
Stop automatically opening pdf in ipad
When I look at my emails on my iPad some pdf attachments are already open on the page. Some pdf's I like to open in iBooks so a copy is kept. How can I do that when the pdf is opening and showing within the email?