Re: [Dev] [APIM][2.1.0] "Controlled" visibility Level in API visibility

2017-11-27 Thread Chamalee De Silva
Thanks Praminda.
Merged the changes.



Thanks
Chamalee

On Tue, Nov 28, 2017 at 12:28 PM, Praminda Jayawardana 
wrote:

> Approved
>
> On Tue, Nov 28, 2017 at 12:14 PM, Chamalee De Silva 
> wrote:
>
>> Hi,
>> It seems we have added this up to C5  API definition as well though it is
>> not used.
>> Removed the CONTROLLED visibility from API definition of C5 with PR [1].
>> Please review and approve.
>>
>>
>> [1] https://github.com/wso2/carbon-apimgt/pull/4767
>>
>>
>> On Mon, Nov 27, 2017 at 6:46 PM, Sanjeewa Malalgoda 
>> wrote:
>>
>>> Sometimes back we had this feature with API Manager and later we removed
>>> that. With that we can select set of tenants we need to expose our API.
>>> I do not think we have usages of this feature. It was there in APIM
>>> 1.4.0 as remember and removed in 1.6.0 or later version.
>>>
>>> [1]https://docs.wso2.com/display/AM140/API+Visibility
>>>
>>> Thanks,
>>> sanjeewa.
>>>
>>> On Mon, Nov 27, 2017 at 5:34 PM, Chamalee De Silva 
>>> wrote:
>>>
 Hi team,

 In our visibility model of API in C4, we have following three types of
 visibility which are documented.


- Public:
-

Restricted by Roles (restrcted)
-

Visible to my domain: (private)


 But when checking with the code (I am refering to the C4 code), I could
 found that there is another visibility level called *controlled.*

 This *controlled* visibility level goes with a list of
 "visibleTenants", but could not find any usage of it.
 When adding or updating an API as well as when retrieving the API this
 "visibleTenants" is added if available [1].

 Can anyone point out what is the use of this controlled visibility
 level and is there a way to control visibility for specific tenants through
 this without UI ?


 When it comes to subscription availability, there is a
 separate property "subscriptionTenants" for the API, so this
 "visibleTenants" is not related to that.

 Any reason for keeping this *controlled* visibility level ?
 Even in the REST API we have added this though it seems not used.




 [1] https://github.com/wso2/carbon-apimgt/blob/6.1.x/components/
 apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/
 wso2/carbon/apimgt/hostobjects/APIProviderHostObject.java#L1737




 --
 Thanks & Regards,

 *Chamalee De Silva*
 Software Engineer
 *WS**O2* Inc. :http://wso2.com/

 Office   :- *+94 11 2145345 <%2B94%2011%202145345>*
 mobile  :- *+94 7 <%2B94%2077%202782039>1 4315942*


>>>
>>>
>>> --
>>>
>>> *Sanjeewa Malalgoda*
>>> WSO2 Inc.
>>> Mobile : +94713068779 <+94%2071%20306%208779>
>>>
>>> blog
>>> :http://sanjeewamalalgoda.blogspot.com/
>>> 
>>>
>>>
>>>
>>
>>
>> --
>> Thanks & Regards,
>>
>> *Chamalee De Silva*
>> Software Engineer
>> *WS**O2* Inc. :http://wso2.com/
>>
>> Office   :- *+94 11 2145345 <%2B94%2011%202145345>*
>> mobile  :- *+94 7 <%2B94%2077%202782039>1 4315942*
>>
>>
>
>
> --
>
> *Praminda Jayawardana*
> Software Engineer
> WSO2 Inc.; http://wso2.com
> Mobile : +94 (0) 716 590918 <+94%2071%20659%200918>
>



-- 
Thanks & Regards,

*Chamalee De Silva*
Software Engineer
*WS**O2* Inc. :http://wso2.com/

Office   :- *+94 11 2145345 <%2B94%2011%202145345>*
mobile  :- *+94 7 <%2B94%2077%202782039>1 4315942*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [APIM][2.1.0] "Controlled" visibility Level in API visibility

2017-11-27 Thread Praminda Jayawardana
Approved

On Tue, Nov 28, 2017 at 12:14 PM, Chamalee De Silva 
wrote:

> Hi,
> It seems we have added this up to C5  API definition as well though it is
> not used.
> Removed the CONTROLLED visibility from API definition of C5 with PR [1].
> Please review and approve.
>
>
> [1] https://github.com/wso2/carbon-apimgt/pull/4767
>
>
> On Mon, Nov 27, 2017 at 6:46 PM, Sanjeewa Malalgoda 
> wrote:
>
>> Sometimes back we had this feature with API Manager and later we removed
>> that. With that we can select set of tenants we need to expose our API.
>> I do not think we have usages of this feature. It was there in APIM 1.4.0
>> as remember and removed in 1.6.0 or later version.
>>
>> [1]https://docs.wso2.com/display/AM140/API+Visibility
>>
>> Thanks,
>> sanjeewa.
>>
>> On Mon, Nov 27, 2017 at 5:34 PM, Chamalee De Silva 
>> wrote:
>>
>>> Hi team,
>>>
>>> In our visibility model of API in C4, we have following three types of
>>> visibility which are documented.
>>>
>>>
>>>- Public:
>>>-
>>>
>>>Restricted by Roles (restrcted)
>>>-
>>>
>>>Visible to my domain: (private)
>>>
>>>
>>> But when checking with the code (I am refering to the C4 code), I could
>>> found that there is another visibility level called *controlled.*
>>>
>>> This *controlled* visibility level goes with a list of
>>> "visibleTenants", but could not find any usage of it.
>>> When adding or updating an API as well as when retrieving the API this
>>> "visibleTenants" is added if available [1].
>>>
>>> Can anyone point out what is the use of this controlled visibility level
>>> and is there a way to control visibility for specific tenants through this
>>> without UI ?
>>>
>>>
>>> When it comes to subscription availability, there is a separate property
>>> "subscriptionTenants" for the API, so this "visibleTenants" is not related
>>> to that.
>>>
>>> Any reason for keeping this *controlled* visibility level ?
>>> Even in the REST API we have added this though it seems not used.
>>>
>>>
>>>
>>>
>>> [1] https://github.com/wso2/carbon-apimgt/blob/6.1.x/components/
>>> apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/
>>> wso2/carbon/apimgt/hostobjects/APIProviderHostObject.java#L1737
>>>
>>>
>>>
>>>
>>> --
>>> Thanks & Regards,
>>>
>>> *Chamalee De Silva*
>>> Software Engineer
>>> *WS**O2* Inc. :http://wso2.com/
>>>
>>> Office   :- *+94 11 2145345 <%2B94%2011%202145345>*
>>> mobile  :- *+94 7 <%2B94%2077%202782039>1 4315942*
>>>
>>>
>>
>>
>> --
>>
>> *Sanjeewa Malalgoda*
>> WSO2 Inc.
>> Mobile : +94713068779 <+94%2071%20306%208779>
>>
>> blog
>> :http://sanjeewamalalgoda.blogspot.com/
>> 
>>
>>
>>
>
>
> --
> Thanks & Regards,
>
> *Chamalee De Silva*
> Software Engineer
> *WS**O2* Inc. :http://wso2.com/
>
> Office   :- *+94 11 2145345 <%2B94%2011%202145345>*
> mobile  :- *+94 7 <%2B94%2077%202782039>1 4315942*
>
>


-- 

*Praminda Jayawardana*
Software Engineer
WSO2 Inc.; http://wso2.com
Mobile : +94 (0) 716 590918
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [APIM][2.1.0] "Controlled" visibility Level in API visibility

2017-11-27 Thread Chamalee De Silva
Hi,
It seems we have added this up to C5  API definition as well though it is
not used.
Removed the CONTROLLED visibility from API definition of C5 with PR [1].
Please review and approve.


[1] https://github.com/wso2/carbon-apimgt/pull/4767


On Mon, Nov 27, 2017 at 6:46 PM, Sanjeewa Malalgoda 
wrote:

> Sometimes back we had this feature with API Manager and later we removed
> that. With that we can select set of tenants we need to expose our API.
> I do not think we have usages of this feature. It was there in APIM 1.4.0
> as remember and removed in 1.6.0 or later version.
>
> [1]https://docs.wso2.com/display/AM140/API+Visibility
>
> Thanks,
> sanjeewa.
>
> On Mon, Nov 27, 2017 at 5:34 PM, Chamalee De Silva 
> wrote:
>
>> Hi team,
>>
>> In our visibility model of API in C4, we have following three types of
>> visibility which are documented.
>>
>>
>>- Public:
>>-
>>
>>Restricted by Roles (restrcted)
>>-
>>
>>Visible to my domain: (private)
>>
>>
>> But when checking with the code (I am refering to the C4 code), I could
>> found that there is another visibility level called *controlled.*
>>
>> This *controlled* visibility level goes with a list of "visibleTenants",
>> but could not find any usage of it.
>> When adding or updating an API as well as when retrieving the API this
>> "visibleTenants" is added if available [1].
>>
>> Can anyone point out what is the use of this controlled visibility level
>> and is there a way to control visibility for specific tenants through this
>> without UI ?
>>
>>
>> When it comes to subscription availability, there is a separate property
>> "subscriptionTenants" for the API, so this "visibleTenants" is not related
>> to that.
>>
>> Any reason for keeping this *controlled* visibility level ?
>> Even in the REST API we have added this though it seems not used.
>>
>>
>>
>>
>> [1] https://github.com/wso2/carbon-apimgt/blob/6.1.x/components/
>> apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/
>> wso2/carbon/apimgt/hostobjects/APIProviderHostObject.java#L1737
>>
>>
>>
>>
>> --
>> Thanks & Regards,
>>
>> *Chamalee De Silva*
>> Software Engineer
>> *WS**O2* Inc. :http://wso2.com/
>>
>> Office   :- *+94 11 2145345 <%2B94%2011%202145345>*
>> mobile  :- *+94 7 <%2B94%2077%202782039>1 4315942*
>>
>>
>
>
> --
>
> *Sanjeewa Malalgoda*
> WSO2 Inc.
> Mobile : +94713068779 <+94%2071%20306%208779>
>
> blog :http://sanjeewamalalgoda.
> blogspot.com/ 
>
>
>


-- 
Thanks & Regards,

*Chamalee De Silva*
Software Engineer
*WS**O2* Inc. :http://wso2.com/

Office   :- *+94 11 2145345 <%2B94%2011%202145345>*
mobile  :- *+94 7 <%2B94%2077%202782039>1 4315942*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IoTs] Update Device properties of a enrolled device

2017-11-27 Thread Rasika Perera
Hi Sameera,

Would you please let us know the parameters you passed for the API calls.
This seems a bug for me. Please go ahead and create a issue in here[1] with
the detailed reproducing steps.

[1] https://github.com/wso2/product-iots/issues

Best Regards,
Rasika

On Mon, Nov 27, 2017 at 11:09 AM, Sameera Gunarathne 
wrote:

> Hi,
>
> I have created a device type using iot device management APIs and I have
> defined several properties when created device type. So at the enrollment
> time, I push the initial values for these properties using
> DeviceManagementProviderService[1]. But when I try to update the device
> properties after enrollment it did not get updated. I have used both
> *updateDeviceInfo*[2] and *modifyEnrollment*[3] methods in
> DeviceManagementProviderService. Is there a service which can be used to
> update the device properties?
>
> [1] - https://github.com/wso2/carbon-device-mgt/blob/master/
> components/device-mgt/org.wso2.carbon.device.mgt.core/
> src/main/java/org/wso2/carbon/device/mgt/core/service/
> DeviceManagementProviderServiceImpl.java#L162
> [2] - https://github.com/wso2/carbon-device-mgt/blob/master/
> components/device-mgt/org.wso2.carbon.device.mgt.core/
> src/main/java/org/wso2/carbon/device/mgt/core/service/
> DeviceManagementProviderServiceImpl.java#L1181
> [3] - https://github.com/wso2/carbon-device-mgt/blob/master/
> components/device-mgt/org.wso2.carbon.device.mgt.core/
> src/main/java/org/wso2/carbon/device/mgt/core/service/
> DeviceManagementProviderServiceImpl.java#L302
> Thanks & Regards,
> sameera.
> --
> Sameera Gunarathne
> Software Engineer, WSO2 Inc. http://wso2.com
> 
> Email: samee...@wso2.com
> Mobile: +94714155561
>



-- 
With Regards,

*Rasika Perera*
Senior Software Engineer
LinkedIn: http://lk.linkedin.com/in/rasika90



WSO2 Inc. www.wso2.com
lean.enterprise.middleware
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Publisher/Store nodes are throwing an error "unable to find valid certification path to requested target"

2017-11-27 Thread Chalitha Waldeniyage
Hi Samitha,

Yes, those are required parameters. I didn't change anything there.
What i have done is to forced the Nginx to send key manager certificates
since SNI information is not present*. *
That can be done by putting the default keyword highlited in the
configuration


*.   *

server {
listen 443 *default;*
server_name is.dev.wso2.org;
ssl on;
ssl_certificate /etc/nginx/ssl/keymgt.crt;
ssl_certificate_key /etc/nginx/ssl/keymgt.key;
location / {
   proxy_set_header X-Forwarded-Host $host;
   proxy_set_header X-Forwarded-Server $host;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   proxy_set_header Host $http_host;
   proxy_read_timeout 5m;
   proxy_send_timeout 5m;
   proxy_redirect https://ssl.wso2.is.com
https://is.dev.wso2.org;
  proxy_pass https://ssl.wso2.is.com;

  proxy_http_version 1.1;
   proxy_set_header Upgrade $http_upgrade;
   proxy_set_header Connection "upgrade";
}

On Tue, Nov 28, 2017 at 11:11 AM, Samitha Chathuranga 
wrote:

> Hi Chalitha,
>
> Out of curiosity; what were the values given earlier by you for them
> instead of the below lines,
>
> ssl_certificate /etc/nginx/ssl/keymgt.crt;
> ssl_certificate_key /etc/nginx/ssl/keymgt.key;
>
> Were they the default ones as mentioned in the docs [1] as below?
>
> ssl_certificate /etc/nginx/ssl/mgt.crt;
> ssl_certificate_key /etc/nginx/ssl/mgt.key;
>
>
> AFAIK we should configure *ssl_certificate* and *ssl_certificate_key*
> derivatives if we are configuring for https requests (port 443). It is
> mentioned int the docs [1] .
>
> [1] - https://docs.wso2.com/display/AM210/Distributed+Deployment+o
> f+the+Gateway
>
> Regards,
> Samitha
>
> On Mon, Nov 27, 2017 at 11:03 PM, Chalitha Waldeniyage 
> wrote:
>
>> Hi All,
>>
>> Thank you Yasassri and all for the tips to figure out the issue.
>>
>> However we have debugged this issue a little further. The reason for this
>> issue is, although we have imported the correct certificates to
>> client-trustore when SSL handshake takes place, server was sending a wrong
>> certificate to the client.
>> Nginx server has mulitiple SSL certificates configured for the same port
>> (443) which was using for other servers.  Therefore nginx sending a wrong
>> certificate.
>> AFAIK this can happen if the client doesn't send SNI information to the
>> server, So either the client is communicating with SSL 1.0 (which doesn't
>> support SNI) or the client is sending wrong SNI information to the server.
>> (I actually couldn't verify this)
>>
>> As a Temporary solution, I have forced Nginx to send key manager
>> certificates if SNI information is not present. The Nginx configs are as
>> follows.
>>
>> server {
>> listen 443 default;
>> server_name is.dev.wso2.org;
>> ssl on;
>> ssl_certificate /etc/nginx/ssl/keymgt.crt;
>> ssl_certificate_key /etc/nginx/ssl/keymgt.key;
>> location / {
>>proxy_set_header X-Forwarded-Host $host;
>>proxy_set_header X-Forwarded-Server $host;
>>proxy_set_header X-Forwarded-For
>> $proxy_add_x_forwarded_for;
>>proxy_set_header Host $http_host;
>>proxy_read_timeout 5m;
>>proxy_send_timeout 5m;
>>proxy_redirect https://ssl.wso2.is.com
>> https://is.dev.wso2.org;
>>   proxy_pass https://ssl.wso2.is.com;
>>
>>   proxy_http_version 1.1;
>>proxy_set_header Upgrade $http_upgrade;
>>proxy_set_header Connection "upgrade";
>> }
>>
>> This seems like an issue, Is there any config in APIM, I can change to
>> get this property?
>>
>> Thank you,
>> Chalitha.
>>
>>
>> On Mon, Nov 27, 2017 at 4:51 PM, Chalitha Waldeniyage 
>> wrote:
>>
>>> Hi Chamin,
>>>
>>> Those configuration are verified as per [1]. However these are not
>>> manually configured.Used existing puppet configuration.
>>>
>>> [1] https://docs.wso2.com/display/AM210/Distributed+Deployment+o
>>> f+API+Manager
>>>
>>>
>>> Thank you,
>>> Chalitha.
>>>
>>> On Mon, Nov 27, 2017 at 2:53 PM, Chamin Dias  wrote:
>>>
 Hi,

 Based on this answer
 ,
 this error might happen due to datasource configuration in IS. Shall we
 recheck those?

 Thanks.

 On Mon, Nov 27, 2017 at 12:23 PM, Chalitha Waldeniyage <
 chali...@wso2.com> wrote:

>
>
> On Mon, Nov 27, 2017 at 12:20 PM, Chalitha Waldeniyage <
> chali...@wso2.com> wrote:
>
>> Adding  Asela
>>
>> On Mon, Nov 27, 2017 at 11:26 AM, Chalitha Waldeniyage <
>> chali...@wso2.com> wrote:
>>
>>> Hi Harsha/Samitha,
>>>
>>> Yes i have 

Re: [Dev] [DEV] hostname in certificate didn't match: !=

2017-11-27 Thread Isuru Haththotuwa
This means that the actual URL what it was trying to access (km.dev.wso2.org
) presented a certificate with the CN
gw.dev.wso2.org. 
The server at the host km.dev.wso2.com should have a public certificate
with the same hostname as CN. And since you seem to have a common domain
dev.wso2.org, you can generate a SSL key pair with a wildcard - *.
dev.wso2.org. No need to generate separately for each instance.


On Tue, Nov 28, 2017 at 11:21 AM, Nuwan Silva  wrote:

> Hi Team,
>
> I'm getting the above issue when trying to login to publisher. I have
> added the certificates of all the instances of the deployment to a single
> client-truststore and copied to all servers.
>
> checking via
> keytool -list -v -keystore client-truststore.jks
>
> does show the certificates. What can be the cause of this?
>
> TID: [-1234] [] [2017-11-28 05:43:47,637]  INFO {org.wso2.carbon.core.
> internal.permission.update.PermissionUpdater} -  Permission cache updated
> for tenant -1234 {org.wso2.carbon.core.internal.permission.update.
> PermissionUpdater}
> TID: [-1234] [] [2017-11-28 05:43:48,009]  INFO
> {org.apache.axis2.transport.http.HTTPSender} -  Unable to sendViaPost to
> url[https://km.dev.wso2.org:443/services/AuthenticationAdmin]
> {org.apache.axis2.transport.http.HTTPSender}
> javax.net.ssl.SSLException: hostname in certificate didn't match: <
> km.dev.wso2.org> != 
> at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.
> verifyHostName(SSLProtocolSocketFactory.java:436)
> at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.
> verifyHostName(SSLProtocolSocketFactory.java:302)
> at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.
> verifyHostName(SSLProtocolSocketFactory.java:273)
> at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.
> createSocket(SSLProtocolSocketFactory.java:183)
> at org.apache.commons.httpclient.HttpConnection.open(
> HttpConnection.java:707)
> at org.apache.commons.httpclient.MultiThreadedHttpConnectionMan
> ager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionMan
> ager.java:1361)
> at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(
> HttpMethodDirector.java:387)
> at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(
> HttpMethodDirector.java:171)
> at org.apache.commons.httpclient.HttpClient.executeMethod(
> HttpClient.java:397)
> at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(
> AbstractHTTPSender.java:682)
> at org.apache.axis2.transport.http.HTTPSender.sendViaPost(
> HTTPSender.java:195)
> at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
> at org.apache.axis2.transport.http.CommonsHTTPTransportSender.
> writeMessageWithCommons(CommonsHTTPTransportSender.java:451)
> at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(
> CommonsHTTPTransportSender.java:278)
> at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
> at org.apache.axis2.description.OutInAxisOperationClient.send(
> OutInAxisOperation.java:430)
> at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(
> OutInAxisOperation.java:225)
> at org.apache.axis2.client.OperationClient.execute(
> OperationClient.java:149)
> at org.wso2.carbon.authenticator.stub.AuthenticationAdminStub.
> login(AuthenticationAdminStub.java:659)
> at org.wso2.carbon.apimgt.hostobjects.APIProviderHostObject.
> jsFunction_login(APIProviderHostObject.java:267)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
> at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)
> at org.mozilla.javascript.optimizer.OptRuntime.call2(
> OptRuntime.java:42)
> at org.jaggeryjs.rhino.publisher.modules.user.c1._c_anonymous_
> 1(/publisher/modules/user/login.jag:19)
> at org.jaggeryjs.rhino.publisher.modules.user.c1.call(/
> publisher/modules/user/login.jag)
> at org.mozilla.javascript.ScriptRuntime.applyOrCall(
> ScriptRuntime.java:2430)
> at org.mozilla.javascript.BaseFunction.execIdCall(
> BaseFunction.java:269)
> at org.mozilla.javascript.IdFunctionObject.call(
> IdFunctionObject.java:97)
> at org.mozilla.javascript.optimizer.OptRuntime.call2(
> OptRuntime.java:42)
> at org.jaggeryjs.rhino.publisher.modules.user.c0._c_anonymous_
> 1(/publisher/modules/user/module.jag:5)
> at org.jaggeryjs.rhino.publisher.modules.user.c0.call(/
> publisher/modules/user/module.jag)
> at org.mozilla.javascript.optimizer.OptRuntime.callN(
> OptRuntime.java:52)
> 

[Dev] [DEV] hostname in certificate didn't match: !=

2017-11-27 Thread Nuwan Silva
Hi Team,

I'm getting the above issue when trying to login to publisher. I have added
the certificates of all the instances of the deployment to a single
client-truststore and copied to all servers.

checking via
keytool -list -v -keystore client-truststore.jks

does show the certificates. What can be the cause of this?

TID: [-1234] [] [2017-11-28 05:43:47,637]  INFO
{org.wso2.carbon.core.internal.permission.update.PermissionUpdater} -
Permission cache updated for tenant -1234
{org.wso2.carbon.core.internal.permission.update.PermissionUpdater}
TID: [-1234] [] [2017-11-28 05:43:48,009]  INFO
{org.apache.axis2.transport.http.HTTPSender} -  Unable to sendViaPost to
url[https://km.dev.wso2.org:443/services/AuthenticationAdmin]
{org.apache.axis2.transport.http.HTTPSender}
javax.net.ssl.SSLException: hostname in certificate didn't match: <
km.dev.wso2.org> != 
at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:436)
at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:302)
at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:273)
at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:183)
at
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:682)
at
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:195)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:451)
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:278)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:430)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at
org.wso2.carbon.authenticator.stub.AuthenticationAdminStub.login(AuthenticationAdminStub.java:659)
at
org.wso2.carbon.apimgt.hostobjects.APIProviderHostObject.jsFunction_login(APIProviderHostObject.java:267)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
at
org.jaggeryjs.rhino.publisher.modules.user.c1._c_anonymous_1(/publisher/modules/user/login.jag:19)
at
org.jaggeryjs.rhino.publisher.modules.user.c1.call(/publisher/modules/user/login.jag)
at
org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2430)
at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:269)
at
org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:97)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
at
org.jaggeryjs.rhino.publisher.modules.user.c0._c_anonymous_1(/publisher/modules/user/module.jag:5)
at
org.jaggeryjs.rhino.publisher.modules.user.c0.call(/publisher/modules/user/module.jag)
at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52)
at
org.jaggeryjs.rhino.publisher.site.blocks.user.login.ajax.c0._c_anonymous_1(/publisher/site/blocks/user/login/ajax/login.jag:26)
at
org.jaggeryjs.rhino.publisher.site.blocks.user.login.ajax.c0.call(/publisher/site/blocks/user/login/ajax/login.jag)
at org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23)
at
org.jaggeryjs.rhino.publisher.site.blocks.user.login.ajax.c0._c_script_0(/publisher/site/blocks/user/login/ajax/login.jag:5)
at
org.jaggeryjs.rhino.publisher.site.blocks.user.login.ajax.c0.call(/publisher/site/blocks/user/login/ajax/login.jag)
at
org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at
org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at

Re: [Dev] Publisher/Store nodes are throwing an error "unable to find valid certification path to requested target"

2017-11-27 Thread Samitha Chathuranga
Hi Chalitha,

Out of curiosity; what were the values given earlier by you for them
instead of the below lines,

ssl_certificate /etc/nginx/ssl/keymgt.crt;
ssl_certificate_key /etc/nginx/ssl/keymgt.key;

Were they the default ones as mentioned in the docs [1] as below?

ssl_certificate /etc/nginx/ssl/mgt.crt;
ssl_certificate_key /etc/nginx/ssl/mgt.key;


AFAIK we should configure *ssl_certificate* and *ssl_certificate_key*
derivatives if we are configuring for https requests (port 443). It is
mentioned int the docs [1] .

[1] - https://docs.wso2.com/display/AM210/Distributed+Deployment+
of+the+Gateway

Regards,
Samitha

On Mon, Nov 27, 2017 at 11:03 PM, Chalitha Waldeniyage 
wrote:

> Hi All,
>
> Thank you Yasassri and all for the tips to figure out the issue.
>
> However we have debugged this issue a little further. The reason for this
> issue is, although we have imported the correct certificates to
> client-trustore when SSL handshake takes place, server was sending a wrong
> certificate to the client.
> Nginx server has mulitiple SSL certificates configured for the same port
> (443) which was using for other servers.  Therefore nginx sending a wrong
> certificate.
> AFAIK this can happen if the client doesn't send SNI information to the
> server, So either the client is communicating with SSL 1.0 (which doesn't
> support SNI) or the client is sending wrong SNI information to the server.
> (I actually couldn't verify this)
>
> As a Temporary solution, I have forced Nginx to send key manager
> certificates if SNI information is not present. The Nginx configs are as
> follows.
>
> server {
> listen 443 default;
> server_name is.dev.wso2.org;
> ssl on;
> ssl_certificate /etc/nginx/ssl/keymgt.crt;
> ssl_certificate_key /etc/nginx/ssl/keymgt.key;
> location / {
>proxy_set_header X-Forwarded-Host $host;
>proxy_set_header X-Forwarded-Server $host;
>proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
>proxy_set_header Host $http_host;
>proxy_read_timeout 5m;
>proxy_send_timeout 5m;
>proxy_redirect https://ssl.wso2.is.com
> https://is.dev.wso2.org;
>   proxy_pass https://ssl.wso2.is.com;
>
>   proxy_http_version 1.1;
>proxy_set_header Upgrade $http_upgrade;
>proxy_set_header Connection "upgrade";
> }
>
> This seems like an issue, Is there any config in APIM, I can change to get
> this property?
>
> Thank you,
> Chalitha.
>
>
> On Mon, Nov 27, 2017 at 4:51 PM, Chalitha Waldeniyage 
> wrote:
>
>> Hi Chamin,
>>
>> Those configuration are verified as per [1]. However these are not
>> manually configured.Used existing puppet configuration.
>>
>> [1] https://docs.wso2.com/display/AM210/Distributed+Deployment+o
>> f+API+Manager
>>
>>
>> Thank you,
>> Chalitha.
>>
>> On Mon, Nov 27, 2017 at 2:53 PM, Chamin Dias  wrote:
>>
>>> Hi,
>>>
>>> Based on this answer
>>> ,
>>> this error might happen due to datasource configuration in IS. Shall we
>>> recheck those?
>>>
>>> Thanks.
>>>
>>> On Mon, Nov 27, 2017 at 12:23 PM, Chalitha Waldeniyage <
>>> chali...@wso2.com> wrote:
>>>


 On Mon, Nov 27, 2017 at 12:20 PM, Chalitha Waldeniyage <
 chali...@wso2.com> wrote:

> Adding  Asela
>
> On Mon, Nov 27, 2017 at 11:26 AM, Chalitha Waldeniyage <
> chali...@wso2.com> wrote:
>
>> Hi Harsha/Samitha,
>>
>> Yes i have created a self sign certificate as per [1] and imported
>> all the nginx public keys there. I have verified that with above command 
>> as
>> well.
>> Here with I'm attaching the client trust.jks file which i'm using in
>> the servers.
>> Further key manager is fronted via nginx.
>>
>> On Sun, Nov 26, 2017 at 10:09 PM, Samitha Chathuranga <
>> sami...@wso2.com> wrote:
>>
>>> Hi Chalitha,
>>>
>>> Are you pointing KM (from other nodes) through load balancer? I
>>> don't think you have done so. And if you have changed the hostnames of 
>>> the
>>> servers, the default keystore/client-trustore won't work. Refer [1]
>>>
>>> To check which certificates are in a Java keystore, enter the below
>>> command.
>>>
>>> keytool -list -v -keystore client-truststore.jks
>>>
>>>
>>> [1] - https://github.com/wso2/puppet-apim/tree/master/wso2am_runti
>>> me#keystore-and-client-truststore-related-configs
>>>
>>>
>>> Regards,
>>> Samitha
>>>
>>> On Sun, Nov 26, 2017 at 7:17 PM, Harsha Kumara 
>>> wrote:
>>>
 Hi Chalitha,

 It seems KM certificate isn't imported to the trustee. Can you
 verify it? If so we will need to fix 

[Dev] siddhi custom json mapping

2017-11-27 Thread Sameera Gunarathne
Hi Devs,

I need to do a custom json mapping for a payload like following.

{
   "sensorMessages":[
 {
 "sensorID":"10001"
 },
 {
 "sensorID":"10002"
 },
   ]
}

I have defined a custom event mapping on the event reciever as ,


   
   


>From this I get an array of sensor Ids for the sensorID field (i.e
["10001","10002"]). Is there a way to create separate sensor ID entries for
this kind of payload?


Thanks & Regards,
-- 
Sameera Gunarathne
Software Engineer, WSO2 Inc. http://wso2.com

Email: samee...@wso2.com
Mobile: +94714155561
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] IDENTITY-5774: [SCIM] Filtering doesn't support with case insensitive attribute names

2017-11-27 Thread Isuranga Perera
HI,


Use following CURL commands with "userName" attribute in upper and lower
case.

curl -v -k --user PRIMARY/admin:admin
https://localhost:9292/scim/v2/Users?filter=USERNAME+eq+user1

curl -v -k --user PRIMARY/admin:admin
https://localhost:9292/scim/v2/Users?filter=username+eq+user1

Gives following response.

{"schemas":"urn:ietf:params:scim:api:messages:2.0:Error","scimType":"invalidValue","detail":"Not
a valid attribute name/uri","status":"400"}

As per the SCIM2 specification(Refer
https://tools.ietf.org/html/rfc7644#section-3.4.2.2)

Attribute names and attribute operators used in filters are case
insensitive.  For example, the following two expressions will evaluate
to the same logical value:
filter=userName Eq "john"
filter=Username eq "john"

Currently, support for case-insensitive attribute operators but not for
attribute names.


Fixed [1] with PR [2].


[1] https://wso2.org/jira/browse/IDENTITY-5774

[2] https://github.com/wso2/charon/pull/82



Best Regards

Isuranga Perera
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Automated Deployment of APIs on API Manager

2017-11-27 Thread Júnior
Hi Bhathiya, thanks for your help!

Thank you!


2017-11-27 18:02 GMT-02:00 Bhathiya Jayasekara :

> Hi Júnior,
>
> Current import REST API does not support update API feature. It will be
> available in a near future release. Until that you will have to delete APIs
> before importing them, using the REST API[1].
>
> [1] https://docs.wso2.com/display/AM210/apidocs/publisher/#!/operations#
> APIIndividual#apisApiIdDelete
>
> Thanks,
> Bhathiya
>
>


-- 
Francisco Ribeiro
*SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Automated Deployment of APIs on API Manager

2017-11-27 Thread Bhathiya Jayasekara
Hi Júnior,

Current import REST API does not support update API feature. It will be
available in a near future release. Until that you will have to delete APIs
before importing them, using the REST API[1].

[1]
https://docs.wso2.com/display/AM210/apidocs/publisher/#!/operations#APIIndividual#apisApiIdDelete

Thanks,
Bhathiya
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Automated Deployment of APIs on API Manager

2017-11-27 Thread Júnior
Just adding some more information, when we try to import an existing API it
complains saying that already exists an API with the same name.

Thanks,

2017-11-27 17:22 GMT-02:00 Júnior :

> Hi everyone,
>
> For deploying the APIs across the environments, we are using the API
> Import Export tool.
>
> When it is a new API it works fine, but, for example if we need to update
> the API definitions, it doesn't work very well.
>
> How do you usally do this process for deploying the APIs on the different
> environments?
>
> Thanks,
> --
> Francisco Ribeiro
> *SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
>



-- 
Francisco Ribeiro
*SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Automated Deployment of APIs on API Manager

2017-11-27 Thread Júnior
Hi everyone,

For deploying the APIs across the environments, we are using the API Import
Export tool.

When it is a new API it works fine, but, for example if we need to update
the API definitions, it doesn't work very well.

How do you usally do this process for deploying the APIs on the different
environments?

Thanks,
-- 
Francisco Ribeiro
*SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Publisher/Store nodes are throwing an error "unable to find valid certification path to requested target"

2017-11-27 Thread Chalitha Waldeniyage
Hi All,

Thank you Yasassri and all for the tips to figure out the issue.

However we have debugged this issue a little further. The reason for this
issue is, although we have imported the correct certificates to
client-trustore when SSL handshake takes place, server was sending a wrong
certificate to the client.
Nginx server has mulitiple SSL certificates configured for the same port
(443) which was using for other servers.  Therefore nginx sending a wrong
certificate.
AFAIK this can happen if the client doesn't send SNI information to the
server, So either the client is communicating with SSL 1.0 (which doesn't
support SNI) or the client is sending wrong SNI information to the server.
(I actually couldn't verify this)

As a Temporary solution, I have forced Nginx to send key manager
certificates if SNI information is not present. The Nginx configs are as
follows.

server {
listen 443 default;
server_name is.dev.wso2.org;
ssl on;
ssl_certificate /etc/nginx/ssl/keymgt.crt;
ssl_certificate_key /etc/nginx/ssl/keymgt.key;
location / {
   proxy_set_header X-Forwarded-Host $host;
   proxy_set_header X-Forwarded-Server $host;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   proxy_set_header Host $http_host;
   proxy_read_timeout 5m;
   proxy_send_timeout 5m;
   proxy_redirect https://ssl.wso2.is.com
https://is.dev.wso2.org;
  proxy_pass https://ssl.wso2.is.com;

  proxy_http_version 1.1;
   proxy_set_header Upgrade $http_upgrade;
   proxy_set_header Connection "upgrade";
}

This seems like an issue, Is there any config in APIM, I can change to get
this property?

Thank you,
Chalitha.


On Mon, Nov 27, 2017 at 4:51 PM, Chalitha Waldeniyage 
wrote:

> Hi Chamin,
>
> Those configuration are verified as per [1]. However these are not
> manually configured.Used existing puppet configuration.
>
> [1] https://docs.wso2.com/display/AM210/Distributed+Deployment+
> of+API+Manager
>
>
> Thank you,
> Chalitha.
>
> On Mon, Nov 27, 2017 at 2:53 PM, Chamin Dias  wrote:
>
>> Hi,
>>
>> Based on this answer
>> ,
>> this error might happen due to datasource configuration in IS. Shall we
>> recheck those?
>>
>> Thanks.
>>
>> On Mon, Nov 27, 2017 at 12:23 PM, Chalitha Waldeniyage > > wrote:
>>
>>>
>>>
>>> On Mon, Nov 27, 2017 at 12:20 PM, Chalitha Waldeniyage <
>>> chali...@wso2.com> wrote:
>>>
 Adding  Asela

 On Mon, Nov 27, 2017 at 11:26 AM, Chalitha Waldeniyage <
 chali...@wso2.com> wrote:

> Hi Harsha/Samitha,
>
> Yes i have created a self sign certificate as per [1] and imported all
> the nginx public keys there. I have verified that with above command as
> well.
> Here with I'm attaching the client trust.jks file which i'm using in
> the servers.
> Further key manager is fronted via nginx.
>
> On Sun, Nov 26, 2017 at 10:09 PM, Samitha Chathuranga <
> sami...@wso2.com> wrote:
>
>> Hi Chalitha,
>>
>> Are you pointing KM (from other nodes) through load balancer? I don't
>> think you have done so. And if you have changed the hostnames of the
>> servers, the default keystore/client-trustore won't work. Refer [1]
>>
>> To check which certificates are in a Java keystore, enter the below
>> command.
>>
>> keytool -list -v -keystore client-truststore.jks
>>
>>
>> [1] - https://github.com/wso2/puppet-apim/tree/master/wso2am_runti
>> me#keystore-and-client-truststore-related-configs
>>
>>
>> Regards,
>> Samitha
>>
>> On Sun, Nov 26, 2017 at 7:17 PM, Harsha Kumara 
>> wrote:
>>
>>> Hi Chalitha,
>>>
>>> It seems KM certificate isn't imported to the trustee. Can you
>>> verify it? If so we will need to fix it.
>>>
>>> Thanks,
>>> Harsha
>>>
>>> On Sun, Nov 26, 2017 at 1:46 PM, Chalitha Waldeniyage <
>>> chali...@wso2.com> wrote:
>>>
 Hi All,

 I'm setting up an APIM cluster puppet patten 6 using APIM 2.1.0
 puppet scripts[1].
 When I try to generate keys for an application,  pub/store nodes
 are throwing the below error. (IS 5.3.0 used as the Keymanager)
 Additionally in gateway Manager and worker also throwing the
 similar errors in the startup. I have imported the nginx public cert 
 to the
 each node client-truststore.jks file as per instruction in
 [2] .
 Could you please looking to this?


 *pub/store Node error:*
 TID: [-1234] [] [2017-11-26 06:40:15,956] ERROR
 {org.wso2.carbon.apimgt.impl.APIConsumerImpl} - Could not execute

Re: [Dev] [APIM][2.1.0] "Controlled" visibility Level in API visibility

2017-11-27 Thread Sanjeewa Malalgoda
Sometimes back we had this feature with API Manager and later we removed
that. With that we can select set of tenants we need to expose our API.
I do not think we have usages of this feature. It was there in APIM 1.4.0
as remember and removed in 1.6.0 or later version.

[1]https://docs.wso2.com/display/AM140/API+Visibility

Thanks,
sanjeewa.

On Mon, Nov 27, 2017 at 5:34 PM, Chamalee De Silva 
wrote:

> Hi team,
>
> In our visibility model of API in C4, we have following three types of
> visibility which are documented.
>
>
>- Public:
>-
>
>Restricted by Roles (restrcted)
>-
>
>Visible to my domain: (private)
>
>
> But when checking with the code (I am refering to the C4 code), I could
> found that there is another visibility level called *controlled.*
>
> This *controlled* visibility level goes with a list of "visibleTenants",
> but could not find any usage of it.
> When adding or updating an API as well as when retrieving the API this
> "visibleTenants" is added if available [1].
>
> Can anyone point out what is the use of this controlled visibility level
> and is there a way to control visibility for specific tenants through this
> without UI ?
>
>
> When it comes to subscription availability, there is a separate property
> "subscriptionTenants" for the API, so this "visibleTenants" is not related
> to that.
>
> Any reason for keeping this *controlled* visibility level ?
> Even in the REST API we have added this though it seems not used.
>
>
>
>
> [1] https://github.com/wso2/carbon-apimgt/blob/6.1.x/
> components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/
> main/java/org/wso2/carbon/apimgt/hostobjects/APIProviderHostObject.java#
> L1737
>
>
>
>
> --
> Thanks & Regards,
>
> *Chamalee De Silva*
> Software Engineer
> *WS**O2* Inc. :http://wso2.com/
>
> Office   :- *+94 11 2145345 <%2B94%2011%202145345>*
> mobile  :- *+94 7 <%2B94%2077%202782039>1 4315942*
>
>


-- 

*Sanjeewa Malalgoda*
WSO2 Inc.
Mobile : +94713068779

blog
:http://sanjeewamalalgoda.blogspot.com/

___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [APIM][2.1.0] "Controlled" visibility Level in API visibility

2017-11-27 Thread Chamalee De Silva
Hi team,

In our visibility model of API in C4, we have following three types of
visibility which are documented.


   - Public:
   -

   Restricted by Roles (restrcted)
   -

   Visible to my domain: (private)


But when checking with the code (I am refering to the C4 code), I could
found that there is another visibility level called *controlled.*

This *controlled* visibility level goes with a list of "visibleTenants",
but could not find any usage of it.
When adding or updating an API as well as when retrieving the API this
"visibleTenants" is added if available [1].

Can anyone point out what is the use of this controlled visibility level
and is there a way to control visibility for specific tenants through this
without UI ?


When it comes to subscription availability, there is a separate property
"subscriptionTenants" for the API, so this "visibleTenants" is not related
to that.

Any reason for keeping this *controlled* visibility level ?
Even in the REST API we have added this though it seems not used.




[1]
https://github.com/wso2/carbon-apimgt/blob/6.1.x/components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIProviderHostObject.java#L1737




-- 
Thanks & Regards,

*Chamalee De Silva*
Software Engineer
*WS**O2* Inc. :http://wso2.com/

Office   :- *+94 11 2145345 <%2B94%2011%202145345>*
mobile  :- *+94 7 <%2B94%2077%202782039>1 4315942*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [DEV] Transport error: 411 Error: Length Required when logging into the publisher

2017-11-27 Thread Nuwan Silva
Hi Pubudu,

yes, Please find the Nginx configuration below;

upstream ssl.pub.wso2.com {
server 192.168.48.251:9443;
ip_hash;
}

server {
listen 443;
server_name pub.dev.wso2.org;
ssl on;
ssl_certificate /etc/nginx/ssl/pub/publisher.crt;
ssl_certificate_key /etc/nginx/ssl/pub/publisher.key;
location / {
   proxy_set_header X-Forwarded-Host $host;
   proxy_set_header X-Forwarded-Server $host;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   proxy_set_header Host $http_host;
   proxy_read_timeout 5m;
   proxy_send_timeout 5m;
   proxy_redirect https://ssl.pub.wso2.com
https://pub.dev.wso2.org;
   proxy_pass https://ssl.pub.wso2.com;

   proxy_http_version 1.1;
   proxy_set_header Upgrade $http_upgrade;
   proxy_set_header Connection "upgrade";
}

}

On Mon, Nov 27, 2017 at 5:01 PM, Pubudu Gunatilaka  wrote:

> Hi Nuwan,
>
> Could you please verify whether you have Nginx configurations mentioned in
> [1]?
>
> [1] - https://docs.wso2.com/display/CLUSTER44x/Configuring+NGINX
>
> Thank you!
>
> On Mon, Nov 27, 2017 at 7:19 PM, Nuwan Silva  wrote:
>
>> Im getting the below exception when logging into the API publisher. This
>> is a distributed APIM cluster with IS as the auth manager, fronted by nginx
>>
>> Any idea why this is happening?
>>
>> TID: [-1234] [] [2017-11-27 11:02:46,453]  INFO
>> {org.wso2.carbon.core.internal.permission.update.PermissionUpdater} -
>> Permission cache updated for tenant -1234 {org.wso2.carbon.core.internal
>> .permission.update.PermissionUpdater}
>> TID: [-1234] [] [2017-11-27 11:02:46,790]  INFO {
>> org.apache.axis2.transport.http.HTTPSender} -  Unable to sendViaPost to
>> url[https://km.dev.wso2.org:443/services/AuthenticationAdmin] {
>> org.apache.axis2.transport.http.HTTPSender}
>> org.apache.axis2.AxisFault: Transport error: 411 Error: Length Required
>> at org.apache.axis2.transport.http.HTTPSender.handleResponse(
>> HTTPSender.java:326)
>> at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPS
>> ender.java:196)
>> at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.
>> java:77)
>> at org.apache.axis2.transport.http.CommonsHTTPTransportSender.w
>> riteMessageWithCommons(CommonsHTTPTransportSender.java:451)
>> at org.apache.axis2.transport.http.CommonsHTTPTransportSender.i
>> nvoke(CommonsHTTPTransportSender.java:278)
>> at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
>> at org.apache.axis2.description.OutInAxisOperationClient.send(O
>> utInAxisOperation.java:430)
>> at org.apache.axis2.description.OutInAxisOperationClient.execut
>> eImpl(OutInAxisOperation.java:225)
>> at org.apache.axis2.client.OperationClient.execute(OperationCli
>> ent.java:149)
>> at org.wso2.carbon.authenticator.stub.AuthenticationAdminStub.l
>> ogin(AuthenticationAdminStub.java:659)
>> at org.wso2.carbon.apimgt.hostobjects.APIProviderHostObject.jsF
>> unction_login(APIProviderHostObject.java:267)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>> ssorImpl.java:62)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>> thodAccessorImpl.java:43)
>> at java.lang.reflect.Method.invoke(Method.java:498)
>> at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
>> at org.mozilla.javascript.FunctionObject.call(FunctionObject.
>> java:386)
>> at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime
>> .java:42)
>> at org.jaggeryjs.rhino.publisher.modules.user.c1._c_anonymous_1
>> (/publisher/modules/user/login.jag:19)
>> at org.jaggeryjs.rhino.publisher.modules.user.c1.call(/publishe
>> r/modules/user/login.jag)
>> at org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRunti
>> me.java:2430)
>> at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.
>> java:269)
>> at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObjec
>> t.java:97)
>> at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime
>> .java:42)
>> at org.jaggeryjs.rhino.publisher.modules.user.c0._c_anonymous_1
>> (/publisher/modules/user/module.jag:5)
>> at org.jaggeryjs.rhino.publisher.modules.user.c0.call(/publishe
>> r/modules/user/module.jag)
>> at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime
>> .java:52)
>> at org.jaggeryjs.rhino.publisher.site.blocks.user.login.ajax.c0
>> ._c_anonymous_1(/publisher/site/blocks/user/login/ajax/login.jag:26)
>> at org.jaggeryjs.rhino.publisher.site.blocks.user.login.ajax.c0
>> .call(/publisher/site/blocks/user/login/ajax/login.jag)
>> at org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime
>> .java:23)
>> at org.jaggeryjs.rhino.publisher.site.blocks.user.login.ajax.c0
>> 

Re: [Dev] [DEV] Transport error: 411 Error: Length Required when logging into the publisher

2017-11-27 Thread Pubudu Gunatilaka
Hi Nuwan,

Could you please verify whether you have Nginx configurations mentioned in
[1]?

[1] - https://docs.wso2.com/display/CLUSTER44x/Configuring+NGINX

Thank you!

On Mon, Nov 27, 2017 at 7:19 PM, Nuwan Silva  wrote:

> Im getting the below exception when logging into the API publisher. This
> is a distributed APIM cluster with IS as the auth manager, fronted by nginx
>
> Any idea why this is happening?
>
> TID: [-1234] [] [2017-11-27 11:02:46,453]  INFO {org.wso2.carbon.core.
> internal.permission.update.PermissionUpdater} -  Permission cache updated
> for tenant -1234 {org.wso2.carbon.core.internal.permission.update.
> PermissionUpdater}
> TID: [-1234] [] [2017-11-27 11:02:46,790]  INFO
> {org.apache.axis2.transport.http.HTTPSender} -  Unable to sendViaPost to
> url[https://km.dev.wso2.org:443/services/AuthenticationAdmin]
> {org.apache.axis2.transport.http.HTTPSender}
> org.apache.axis2.AxisFault: Transport error: 411 Error: Length Required
> at org.apache.axis2.transport.http.HTTPSender.
> handleResponse(HTTPSender.java:326)
> at org.apache.axis2.transport.http.HTTPSender.sendViaPost(
> HTTPSender.java:196)
> at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
> at org.apache.axis2.transport.http.CommonsHTTPTransportSender.
> writeMessageWithCommons(CommonsHTTPTransportSender.java:451)
> at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(
> CommonsHTTPTransportSender.java:278)
> at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
> at org.apache.axis2.description.OutInAxisOperationClient.send(
> OutInAxisOperation.java:430)
> at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(
> OutInAxisOperation.java:225)
> at org.apache.axis2.client.OperationClient.execute(
> OperationClient.java:149)
> at org.wso2.carbon.authenticator.stub.AuthenticationAdminStub.
> login(AuthenticationAdminStub.java:659)
> at org.wso2.carbon.apimgt.hostobjects.APIProviderHostObject.
> jsFunction_login(APIProviderHostObject.java:267)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
> at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)
> at org.mozilla.javascript.optimizer.OptRuntime.call2(
> OptRuntime.java:42)
> at org.jaggeryjs.rhino.publisher.modules.user.c1._c_anonymous_
> 1(/publisher/modules/user/login.jag:19)
> at org.jaggeryjs.rhino.publisher.modules.user.c1.call(/
> publisher/modules/user/login.jag)
> at org.mozilla.javascript.ScriptRuntime.applyOrCall(
> ScriptRuntime.java:2430)
> at org.mozilla.javascript.BaseFunction.execIdCall(
> BaseFunction.java:269)
> at org.mozilla.javascript.IdFunctionObject.call(
> IdFunctionObject.java:97)
> at org.mozilla.javascript.optimizer.OptRuntime.call2(
> OptRuntime.java:42)
> at org.jaggeryjs.rhino.publisher.modules.user.c0._c_anonymous_
> 1(/publisher/modules/user/module.jag:5)
> at org.jaggeryjs.rhino.publisher.modules.user.c0.call(/
> publisher/modules/user/module.jag)
> at org.mozilla.javascript.optimizer.OptRuntime.callN(
> OptRuntime.java:52)
> at org.jaggeryjs.rhino.publisher.site.blocks.user.login.ajax.
> c0._c_anonymous_1(/publisher/site/blocks/user/login/ajax/login.jag:26)
> at org.jaggeryjs.rhino.publisher.site.blocks.user.login.ajax.
> c0.call(/publisher/site/blocks/user/login/ajax/login.jag)
> at org.mozilla.javascript.optimizer.OptRuntime.call0(
> OptRuntime.java:23)
> at org.jaggeryjs.rhino.publisher.site.blocks.user.login.ajax.
> c0._c_script_0(/publisher/site/blocks/user/login/ajax/login.jag:5)
> at org.jaggeryjs.rhino.publisher.site.blocks.user.login.ajax.
> c0.call(/publisher/site/blocks/user/login/ajax/login.jag)
> at org.mozilla.javascript.ContextFactory.doTopCall(
> ContextFactory.java:394)
> at org.mozilla.javascript.ScriptRuntime.doTopCall(
> ScriptRuntime.java:3091)
> at org.jaggeryjs.rhino.publisher.site.blocks.user.login.ajax.
> c0.call(/publisher/site/blocks/user/login/ajax/login.jag)
> at org.jaggeryjs.rhino.publisher.site.blocks.user.login.ajax.
> c0.exec(/publisher/site/blocks/user/login/ajax/login.jag)
> at org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(
> RhinoEngine.java:567)
> at org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(
> RhinoEngine.java:273)
> at org.jaggeryjs.jaggery.core.manager.WebAppManager.exec(
> WebAppManager.java:588)
> at org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(
> WebAppManager.java:508)
> at org.jaggeryjs.jaggery.core.JaggeryServlet.doPost(
> JaggeryServlet.java:29)
> at 

Re: [Dev] Publisher/Store nodes are throwing an error "unable to find valid certification path to requested target"

2017-11-27 Thread Chalitha Waldeniyage
Hi Chamin,

Those configuration are verified as per [1]. However these are not manually
configured.Used existing puppet configuration.

[1]
https://docs.wso2.com/display/AM210/Distributed+Deployment+of+API+Manager


Thank you,
Chalitha.

On Mon, Nov 27, 2017 at 2:53 PM, Chamin Dias  wrote:

> Hi,
>
> Based on this answer
> ,
> this error might happen due to datasource configuration in IS. Shall we
> recheck those?
>
> Thanks.
>
> On Mon, Nov 27, 2017 at 12:23 PM, Chalitha Waldeniyage 
> wrote:
>
>>
>>
>> On Mon, Nov 27, 2017 at 12:20 PM, Chalitha Waldeniyage > > wrote:
>>
>>> Adding  Asela
>>>
>>> On Mon, Nov 27, 2017 at 11:26 AM, Chalitha Waldeniyage <
>>> chali...@wso2.com> wrote:
>>>
 Hi Harsha/Samitha,

 Yes i have created a self sign certificate as per [1] and imported all
 the nginx public keys there. I have verified that with above command as
 well.
 Here with I'm attaching the client trust.jks file which i'm using in
 the servers.
 Further key manager is fronted via nginx.

 On Sun, Nov 26, 2017 at 10:09 PM, Samitha Chathuranga  wrote:

> Hi Chalitha,
>
> Are you pointing KM (from other nodes) through load balancer? I don't
> think you have done so. And if you have changed the hostnames of the
> servers, the default keystore/client-trustore won't work. Refer [1]
>
> To check which certificates are in a Java keystore, enter the below
> command.
>
> keytool -list -v -keystore client-truststore.jks
>
>
> [1] - https://github.com/wso2/puppet-apim/tree/master/wso2am_runti
> me#keystore-and-client-truststore-related-configs
>
>
> Regards,
> Samitha
>
> On Sun, Nov 26, 2017 at 7:17 PM, Harsha Kumara 
> wrote:
>
>> Hi Chalitha,
>>
>> It seems KM certificate isn't imported to the trustee. Can you verify
>> it? If so we will need to fix it.
>>
>> Thanks,
>> Harsha
>>
>> On Sun, Nov 26, 2017 at 1:46 PM, Chalitha Waldeniyage <
>> chali...@wso2.com> wrote:
>>
>>> Hi All,
>>>
>>> I'm setting up an APIM cluster puppet patten 6 using APIM 2.1.0
>>> puppet scripts[1].
>>> When I try to generate keys for an application,  pub/store nodes are
>>> throwing the below error. (IS 5.3.0 used as the Keymanager)
>>> Additionally in gateway Manager and worker also throwing the similar
>>> errors in the startup. I have imported the nginx public cert to the each
>>> node client-truststore.jks file as per instruction in
>>> [2] .
>>> Could you please looking to this?
>>>
>>>
>>> *pub/store Node error:*
>>> TID: [-1234] [] [2017-11-26 06:40:15,956] ERROR
>>> {org.wso2.carbon.apimgt.impl.APIConsumerImpl} - Could not execute
>>> Workflow {org.wso2.carbon.apimgt.impl.APIConsumerImpl}
>>>
>>> org.wso2.carbon.apimgt.impl.workflow.WorkflowException: Error occurred 
>>> when updating the status of the Application creation process
>>> at 
>>> org.wso2.carbon.apimgt.impl.workflow.ApplicationRegistrationSimpleWorkflowExecutor.complete(ApplicationRegistrationSimpleWorkflowExecutor.java:82)
>>> at 
>>> org.wso2.carbon.apimgt.impl.workflow.ApplicationRegistrationSimpleWorkflowExecutor.execute(ApplicationRegistrationSimpleWorkflowExecutor.java:54)
>>> at 
>>> org.wso2.carbon.apimgt.impl.APIConsumerImpl.requestApprovalForApplicationRegistration(APIConsumerImpl.java:2789)
>>> at 
>>> org.wso2.carbon.apimgt.impl.UserAwareAPIConsumer.requestApprovalForApplicationRegistration(UserAwareAPIConsumer.java:36)
>>> at 
>>> org.wso2.carbon.apimgt.hostobjects.APIStoreHostObject.jsFunction_getApplicationKey(APIStoreHostObject.java:385)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at 
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>> at 
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>> at java.lang.reflect.Method.invoke(Method.java:498)
>>> at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
>>> at 
>>> org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)
>>> at 
>>> org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52)
>>> at 
>>> org.jaggeryjs.rhino.store.modules.subscription.c3._c_anonymous_2(/store/modules/subscription/key.jag:39)
>>> at 
>>> org.jaggeryjs.rhino.store.modules.subscription.c3.call(/store/modules/subscription/key.jag)
>>> at 
>>> 

[Dev] [DEV] Transport error: 411 Error: Length Required when logging into the publisher

2017-11-27 Thread Nuwan Silva
Im getting the below exception when logging into the API publisher. This is
a distributed APIM cluster with IS as the auth manager, fronted by nginx

Any idea why this is happening?

TID: [-1234] [] [2017-11-27 11:02:46,453]  INFO
{org.wso2.carbon.core.internal.permission.update.PermissionUpdater} -
Permission cache updated for tenant -1234
{org.wso2.carbon.core.internal.permission.update.PermissionUpdater}
TID: [-1234] [] [2017-11-27 11:02:46,790]  INFO
{org.apache.axis2.transport.http.HTTPSender} -  Unable to sendViaPost to
url[https://km.dev.wso2.org:443/services/AuthenticationAdmin]
{org.apache.axis2.transport.http.HTTPSender}
org.apache.axis2.AxisFault: Transport error: 411 Error: Length Required
at
org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:326)
at
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:196)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:451)
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:278)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:430)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at
org.wso2.carbon.authenticator.stub.AuthenticationAdminStub.login(AuthenticationAdminStub.java:659)
at
org.wso2.carbon.apimgt.hostobjects.APIProviderHostObject.jsFunction_login(APIProviderHostObject.java:267)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
at
org.jaggeryjs.rhino.publisher.modules.user.c1._c_anonymous_1(/publisher/modules/user/login.jag:19)
at
org.jaggeryjs.rhino.publisher.modules.user.c1.call(/publisher/modules/user/login.jag)
at
org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2430)
at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:269)
at
org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:97)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
at
org.jaggeryjs.rhino.publisher.modules.user.c0._c_anonymous_1(/publisher/modules/user/module.jag:5)
at
org.jaggeryjs.rhino.publisher.modules.user.c0.call(/publisher/modules/user/module.jag)
at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52)
at
org.jaggeryjs.rhino.publisher.site.blocks.user.login.ajax.c0._c_anonymous_1(/publisher/site/blocks/user/login/ajax/login.jag:26)
at
org.jaggeryjs.rhino.publisher.site.blocks.user.login.ajax.c0.call(/publisher/site/blocks/user/login/ajax/login.jag)
at org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23)
at
org.jaggeryjs.rhino.publisher.site.blocks.user.login.ajax.c0._c_script_0(/publisher/site/blocks/user/login/ajax/login.jag:5)
at
org.jaggeryjs.rhino.publisher.site.blocks.user.login.ajax.c0.call(/publisher/site/blocks/user/login/ajax/login.jag)
at
org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at
org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at
org.jaggeryjs.rhino.publisher.site.blocks.user.login.ajax.c0.call(/publisher/site/blocks/user/login/ajax/login.jag)
at
org.jaggeryjs.rhino.publisher.site.blocks.user.login.ajax.c0.exec(/publisher/site/blocks/user/login/ajax/login.jag)
at
org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:567)
at
org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:273)
at
org.jaggeryjs.jaggery.core.manager.WebAppManager.exec(WebAppManager.java:588)
at
org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(WebAppManager.java:508)
at
org.jaggeryjs.jaggery.core.JaggeryServlet.doPost(JaggeryServlet.java:29)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:743)
at

Re: [Dev] How to validate email adddress

2017-11-27 Thread Senduran Balasubramaniyam
Also you need to use the template with + sign since its value can contain @

uri-template="/{*+*id}"

Regards
Senduran




On Mon, Nov 27, 2017 at 3:24 PM, Abimaran Kugathasan 
wrote:

> Hi Dilusha,
>
> Since you have defined is as path parameter in the template, you must use '
> uri.var.id' instead of 'query.param.id' in the filter mediator like below.
>
> 
>
> On Sat, Nov 25, 2017 at 11:37 AM, Dilusha Alphonso 
> wrote:
>
>> Hi All,
>>
>> Requirement: I need to check a condition " Patient ID is the email
>> address of given patient". When I give any string to the ID, it must be an
>> email address. I have to validate ID whether it is in email format. For
>> this, I used the filter mediator in ESB, But I noticed my request didn't go
>> through that filter mediator.
>>
>> I attached my API configuration in ESB. Please, anyone, help me to
>> validate the email address with ID.
>>
>> http://ws.apache.org/ns/synapse; name="Durdan"
>> context="/test">
>>
>>   
>>  
>>  > regex="/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/">
>> 
>>
>>
>>   
>>  http://schemas.
>> xmlsoap.org/soap/envelope/">
>> 
>>17
>> 
>> 
>>http://service.sample.durdans.com;>
>>   $1
>>
>> 
>>  
>>   
>>   
>>  
>>   
>>
>>
>>> scope="transport"/>
>>
>>   
>>  
>>   
>>
>>
>>> scope="axis2" type="STRING"/>
>> 
>> 
>>
>>   > value="deef"/>
>>
>> 
>>  
>>   
>>   
>>  
>>   
>>
>> 
>>
>> Thanks
>> Dilusha
>>
>>
>>
>>
>>
>> before loop back to out sequence whether the USER_NAME and PATIENT_ID are
>> equal.
>>
>> --
>>
>>
>> *Best Regards,Dilusha Alphonso*
>>
>> *Software Engineer - Support Team*
>>
>>
>> *WSO2*
>> *Mobile : *
>>
>> *+94766837098 <+94%2076%20683%207098>[image: http://wso2.com/signature]
>> *
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Thanks
> Abimaran Kugathasan
> Senior Software Engineer - API Technologies
>
> Email : abima...@wso2.com
> Mobile : +94 773922820 <+94%2077%20392%202820>
>
> 
> 
>   
> 
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Senduran *
Senior Software Engineer,
WSO2, Inc.;  http://wso2.com/ 
Mobile: +94 77 952 6548
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How to validate email adddress

2017-11-27 Thread Abimaran Kugathasan
Hi Dilusha,

Since you have defined is as path parameter in the template, you must use '
uri.var.id' instead of 'query.param.id' in the filter mediator like below.



On Sat, Nov 25, 2017 at 11:37 AM, Dilusha Alphonso  wrote:

> Hi All,
>
> Requirement: I need to check a condition " Patient ID is the email address
> of given patient". When I give any string to the ID, it must be an email
> address. I have to validate ID whether it is in email format. For this, I
> used the filter mediator in ESB, But I noticed my request didn't go through
> that filter mediator.
>
> I attached my API configuration in ESB. Please, anyone, help me to
> validate the email address with ID.
>
> http://ws.apache.org/ns/synapse; name="Durdan"
> context="/test">
>
>   
>  
>   regex="/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/">
> 
>
>
>   
>  http://schemas.
> xmlsoap.org/soap/envelope/">
> 
>17
> 
> 
>http://service.
> sample.durdans.com">
>   $1
>
> 
>  
>   
>   
>  
>   
>
>
> scope="transport"/>
>
>   
>  
>   
>
>
> scope="axis2" type="STRING"/>
> 
> 
>
>   
>
> 
>  
>   
>   
>  
>   
>
> 
>
> Thanks
> Dilusha
>
>
>
>
>
> before loop back to out sequence whether the USER_NAME and PATIENT_ID are
> equal.
>
> --
>
>
> *Best Regards,Dilusha Alphonso*
>
> *Software Engineer - Support Team*
>
>
> *WSO2*
> *Mobile : *
>
> *+94766837098 <+94%2076%20683%207098>[image: http://wso2.com/signature]
> *
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Thanks
Abimaran Kugathasan
Senior Software Engineer - API Technologies

Email : abima...@wso2.com
Mobile : +94 773922820


  
  
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Disabling HTTP Transports in Carbon Servers - Servlet and Passthru

2017-11-27 Thread Niranjan Karunanandham
Hi Isuru,

As per the offline discussion, can you remove the http tag in the
catalina-server.xml and verify it? This is for the 9763 port.

Regards,
Nira

On Mon, Nov 27, 2017 at 2:42 PM, Abimaran Kugathasan 
wrote:

> Hi Isuru,
>
> Servlet HTTP transport is by default is disabled and you can enable it
> through EnableHTTPAdminConsole property[1]. For passthrough transport, we
> can disable HTTP transportReceiver and transportSender in axis2.xml file.
>
> [1]: Enable WSO2 Carbon Management Console via HTTP Transport not working?
>
> On Mon, Nov 27, 2017 at 2:18 PM, Isuru Haththotuwa 
> wrote:
>
>>
>>
>> On Mon, Nov 27, 2017 at 1:57 PM, Rukshan Premathunga 
>> wrote:
>>
>>> Hi Isuru,
>>>
>>> It is already reported[1]
>>>
>>> [1] https://wso2.org/jira/browse/DOCUMENTATION-4179
>>>
>> This is about enabling HTTP access, but am trying to disable them at the
>> transport level.
>>
>>>
>>> Thanks and Regards
>>>
>>> On Mon, Nov 27, 2017 at 1:40 PM, Isuru Haththotuwa 
>>> wrote:
>>>
 Hi Devs,

 Do we have documentation for $subject?

 --
 Thanks and Regards,

 Isuru H.
 +94 716 358 048 <+94%2071%20635%208048>* *



 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev


>>>
>>>
>>> --
>>> Rukshan Chathuranga.
>>> Software Engineer.
>>> WSO2, Inc.
>>> +94711822074 <071%20182%202074>
>>>
>>
>>
>>
>> --
>> Thanks and Regards,
>>
>> Isuru H.
>> +94 716 358 048 <071%20635%208048>* *
>>
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Thanks
> Abimaran Kugathasan
> Senior Software Engineer - API Technologies
>
> Email : abima...@wso2.com
> Mobile : +94 773922820 <+94%2077%20392%202820>
>
> 
> 
>   
> 
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 


*Niranjan Karunanandham*
Associate Technical Lead - WSO2 Inc.
WSO2 Inc.: http://www.wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Publisher/Store nodes are throwing an error "unable to find valid certification path to requested target"

2017-11-27 Thread Chamin Dias
Hi,

Based on this answer
,
this error might happen due to datasource configuration in IS. Shall we
recheck those?

Thanks.

On Mon, Nov 27, 2017 at 12:23 PM, Chalitha Waldeniyage 
wrote:

>
>
> On Mon, Nov 27, 2017 at 12:20 PM, Chalitha Waldeniyage 
> wrote:
>
>> Adding  Asela
>>
>> On Mon, Nov 27, 2017 at 11:26 AM, Chalitha Waldeniyage > > wrote:
>>
>>> Hi Harsha/Samitha,
>>>
>>> Yes i have created a self sign certificate as per [1] and imported all
>>> the nginx public keys there. I have verified that with above command as
>>> well.
>>> Here with I'm attaching the client trust.jks file which i'm using in the
>>> servers.
>>> Further key manager is fronted via nginx.
>>>
>>> On Sun, Nov 26, 2017 at 10:09 PM, Samitha Chathuranga 
>>> wrote:
>>>
 Hi Chalitha,

 Are you pointing KM (from other nodes) through load balancer? I don't
 think you have done so. And if you have changed the hostnames of the
 servers, the default keystore/client-trustore won't work. Refer [1]

 To check which certificates are in a Java keystore, enter the below
 command.

 keytool -list -v -keystore client-truststore.jks


 [1] - https://github.com/wso2/puppet-apim/tree/master/wso2am_runti
 me#keystore-and-client-truststore-related-configs


 Regards,
 Samitha

 On Sun, Nov 26, 2017 at 7:17 PM, Harsha Kumara 
 wrote:

> Hi Chalitha,
>
> It seems KM certificate isn't imported to the trustee. Can you verify
> it? If so we will need to fix it.
>
> Thanks,
> Harsha
>
> On Sun, Nov 26, 2017 at 1:46 PM, Chalitha Waldeniyage <
> chali...@wso2.com> wrote:
>
>> Hi All,
>>
>> I'm setting up an APIM cluster puppet patten 6 using APIM 2.1.0
>> puppet scripts[1].
>> When I try to generate keys for an application,  pub/store nodes are
>> throwing the below error. (IS 5.3.0 used as the Keymanager)
>> Additionally in gateway Manager and worker also throwing the similar
>> errors in the startup. I have imported the nginx public cert to the each
>> node client-truststore.jks file as per instruction in
>> [2] .
>> Could you please looking to this?
>>
>>
>> *pub/store Node error:*
>> TID: [-1234] [] [2017-11-26 06:40:15,956] ERROR
>> {org.wso2.carbon.apimgt.impl.APIConsumerImpl} - Could not execute
>> Workflow {org.wso2.carbon.apimgt.impl.APIConsumerImpl}
>>
>> org.wso2.carbon.apimgt.impl.workflow.WorkflowException: Error occurred 
>> when updating the status of the Application creation process
>>  at 
>> org.wso2.carbon.apimgt.impl.workflow.ApplicationRegistrationSimpleWorkflowExecutor.complete(ApplicationRegistrationSimpleWorkflowExecutor.java:82)
>>  at 
>> org.wso2.carbon.apimgt.impl.workflow.ApplicationRegistrationSimpleWorkflowExecutor.execute(ApplicationRegistrationSimpleWorkflowExecutor.java:54)
>>  at 
>> org.wso2.carbon.apimgt.impl.APIConsumerImpl.requestApprovalForApplicationRegistration(APIConsumerImpl.java:2789)
>>  at 
>> org.wso2.carbon.apimgt.impl.UserAwareAPIConsumer.requestApprovalForApplicationRegistration(UserAwareAPIConsumer.java:36)
>>  at 
>> org.wso2.carbon.apimgt.hostobjects.APIStoreHostObject.jsFunction_getApplicationKey(APIStoreHostObject.java:385)
>>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>  at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>  at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>  at java.lang.reflect.Method.invoke(Method.java:498)
>>  at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
>>  at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)
>>  at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52)
>>  at 
>> org.jaggeryjs.rhino.store.modules.subscription.c3._c_anonymous_2(/store/modules/subscription/key.jag:39)
>>  at 
>> org.jaggeryjs.rhino.store.modules.subscription.c3.call(/store/modules/subscription/key.jag)
>>  at 
>> org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2430)
>>  at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:269)
>>  at 
>> org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:97)
>>  at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
>>  at 
>> org.jaggeryjs.rhino.store.modules.subscription.c0._c_anonymous_10(/store/modules/subscription/module.jag:35)
>>  at 
>> org.jaggeryjs.rhino.store.modules.subscription.c0.call(/store/modules/subscription/module.jag)
>>  at 

Re: [Dev] Retrieving API details via carbon REST API admin service

2017-11-27 Thread Sumedha Kodithuwakku
Hi all,

When checking the XML content returned from the RestApiAdmin service, some
more informations are missing from the XML content (i.e Version
information).

IMO we can return the XML content of the API synapse file in [1] without
building it by creating each sub element which will fix the above issue.

@ESB Team,
Appriciate your thoughts on this..

[1]
https://github.com/wso2/carbon-mediation/blob/release-4.6.10/components/mediation-admin/org.wso2.carbon.rest.api/src/main/java/org/wso2/carbon/rest/api/RestApiAdminUtils.java#L59

Regards,
SumedhaS



On Mon, Nov 27, 2017 at 9:39 AM, Prasanna Dangalla 
wrote:

> On Mon, Nov 27, 2017 at 7:50 AM, roshan wijesena 
> wrote:
>
>> Have you tried these APIs?
>>
>> https://docs.wso2.com/display/AM210/apidocs/publisher/
>>
> AFAIK if you get it form pubiisher REST API it will have all the data in
> an API artifact.  So may be you can use this.
>
>>
>>
>> On Mon, Nov 27, 2017 at 2:45 AM, Amanda Jayanetti 
>> wrote:
>>
>>> Hi all,
>>>
>>> For a task that I'm currently working on, I need to retrieve all APIs
>>> that have been created/published by a particular tenant. In order to
>>> do this, we tried using carbon REST API admin service but details of API
>>> handlers were not returned by this service. Is this the expected behavior?
>>> If so, is there any other way of retrieving these details?
>>>
>>> Best Regards,
>>> Amanda
>>> --
>>> *Amanda Jayanetti*
>>> Software Engineer
>>> WSO2, Inc.; http://wso2.com
>>>
>>> Mobile: +9471957591 <+94%2071%20185%202792>1
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Sumedha Kodithuwakku*
Associate Technical Lead
WSO2 Inc. : http://wso2.com
lean . enterprise . middleware

Mobile: +94 71 808 1124
Blog: http://sumedhask.blogspot.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Disabling HTTP Transports in Carbon Servers - Servlet and Passthru

2017-11-27 Thread Abimaran Kugathasan
Hi Isuru,

Servlet HTTP transport is by default is disabled and you can enable it
through EnableHTTPAdminConsole property[1]. For passthrough transport, we
can disable HTTP transportReceiver and transportSender in axis2.xml file.

[1]: Enable WSO2 Carbon Management Console via HTTP Transport not working?

On Mon, Nov 27, 2017 at 2:18 PM, Isuru Haththotuwa  wrote:

>
>
> On Mon, Nov 27, 2017 at 1:57 PM, Rukshan Premathunga 
> wrote:
>
>> Hi Isuru,
>>
>> It is already reported[1]
>>
>> [1] https://wso2.org/jira/browse/DOCUMENTATION-4179
>>
> This is about enabling HTTP access, but am trying to disable them at the
> transport level.
>
>>
>> Thanks and Regards
>>
>> On Mon, Nov 27, 2017 at 1:40 PM, Isuru Haththotuwa 
>> wrote:
>>
>>> Hi Devs,
>>>
>>> Do we have documentation for $subject?
>>>
>>> --
>>> Thanks and Regards,
>>>
>>> Isuru H.
>>> +94 716 358 048 <+94%2071%20635%208048>* *
>>>
>>>
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Rukshan Chathuranga.
>> Software Engineer.
>> WSO2, Inc.
>> +94711822074 <071%20182%202074>
>>
>
>
>
> --
> Thanks and Regards,
>
> Isuru H.
> +94 716 358 048 <071%20635%208048>* *
>
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Thanks
Abimaran Kugathasan
Senior Software Engineer - API Technologies

Email : abima...@wso2.com
Mobile : +94 773922820


  
  
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Disabling HTTP Transports in Carbon Servers - Servlet and Passthru

2017-11-27 Thread Isuru Haththotuwa
On Mon, Nov 27, 2017 at 1:57 PM, Rukshan Premathunga 
wrote:

> Hi Isuru,
>
> It is already reported[1]
>
> [1] https://wso2.org/jira/browse/DOCUMENTATION-4179
>
This is about enabling HTTP access, but am trying to disable them at the
transport level.

>
> Thanks and Regards
>
> On Mon, Nov 27, 2017 at 1:40 PM, Isuru Haththotuwa 
> wrote:
>
>> Hi Devs,
>>
>> Do we have documentation for $subject?
>>
>> --
>> Thanks and Regards,
>>
>> Isuru H.
>> +94 716 358 048 <+94%2071%20635%208048>* *
>>
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Rukshan Chathuranga.
> Software Engineer.
> WSO2, Inc.
> +94711822074 <071%20182%202074>
>



-- 
Thanks and Regards,

Isuru H.
+94 716 358 048 <071%20635%208048>* *
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Disabling HTTP Transports in Carbon Servers - Servlet and Passthru

2017-11-27 Thread Rukshan Premathunga
Hi Isuru,

It is already reported[1]

[1] https://wso2.org/jira/browse/DOCUMENTATION-4179

Thanks and Regards

On Mon, Nov 27, 2017 at 1:40 PM, Isuru Haththotuwa  wrote:

> Hi Devs,
>
> Do we have documentation for $subject?
>
> --
> Thanks and Regards,
>
> Isuru H.
> +94 716 358 048 <+94%2071%20635%208048>* *
>
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Rukshan Chathuranga.
Software Engineer.
WSO2, Inc.
+94711822074
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Disabling HTTP Transports in Carbon Servers - Servlet and Passthru

2017-11-27 Thread Isuru Haththotuwa
Hi Devs,

Do we have documentation for $subject?

-- 
Thanks and Regards,

Isuru H.
+94 716 358 048* *
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev